98 lines · plain
1# Tests that an associative comdat being associated with another2# associated comdat later in the file produces an error.3# RUN: sed -e s/ASSOC1/2/ -e s/ASSOC2/3/ %s | yaml2obj > %t.obj4# RUN: not lld-link /include:symbol /dll /noentry /nodefaultlib %t.obj /out:%t.exe 2>&1 | FileCheck --check-prefix=FORWARD %s5# FORWARD: lld-link: error: {{.*}}: associative comdat .text$ac1 (sec 1) has invalid reference to section .text$ac2 (sec 2)6# FORWARD-NOT: lld-link: error:7 8# Tests that an associative comdat being associated with another9# associated comdat earlier in the file works.10# RUN: sed -e s/ASSOC1/3/ -e s/ASSOC2/1/ %s | yaml2obj > %t.obj11 12# RUN: lld-link /include:symbol /dll /noentry /nodefaultlib %t.obj /out:%t.exe13# RUN: llvm-objdump -s %t.exe | FileCheck --check-prefix=BACKWARD %s14# BACKWARD: Contents of section .text:15# BACKWARD: 180001000 01000000 02000000 03000000 ............16 17# RUN: lld-link /dll /noentry /nodefaultlib %t.obj /out:%t.exe18# RUN: llvm-objdump -s %t.exe | FileCheck --check-prefix=BACKWARDDROP %s19# BACKWARDDROP-NOT: Contents of section .text:20 21--- !COFF22header: 23 Machine: IMAGE_FILE_MACHINE_AMD6424 Characteristics: [ ]25sections: 26 - Name: '.text$ac1'27 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]28 Alignment: 129 SectionData: '01000000'30 - Name: '.text$ac2'31 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]32 Alignment: 133 SectionData: '02000000'34 - Name: '.text$nm'35 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]36 Alignment: 137 SectionData: '03000000'38symbols: 39 - Name: '.text$ac1'40 Value: 041 SectionNumber: 142 SimpleType: IMAGE_SYM_TYPE_NULL43 ComplexType: IMAGE_SYM_DTYPE_NULL44 StorageClass: IMAGE_SYM_CLASS_STATIC45 SectionDefinition: 46 Length: 447 NumberOfRelocations: 048 NumberOfLinenumbers: 049 CheckSum: 309935498150 Number: ASSOC151 Selection: IMAGE_COMDAT_SELECT_ASSOCIATIVE52 - Name: '.text$ac2'53 Value: 054 SectionNumber: 255 SimpleType: IMAGE_SYM_TYPE_NULL56 ComplexType: IMAGE_SYM_DTYPE_NULL57 StorageClass: IMAGE_SYM_CLASS_STATIC58 SectionDefinition: 59 Length: 460 NumberOfRelocations: 061 NumberOfLinenumbers: 062 CheckSum: 309935498163 Number: ASSOC264 Selection: IMAGE_COMDAT_SELECT_ASSOCIATIVE65 - Name: '.text$nm'66 Value: 067 SectionNumber: 368 SimpleType: IMAGE_SYM_TYPE_NULL69 ComplexType: IMAGE_SYM_DTYPE_NULL70 StorageClass: IMAGE_SYM_CLASS_STATIC71 SectionDefinition: 72 Length: 473 NumberOfRelocations: 074 NumberOfLinenumbers: 075 CheckSum: 309935498176 Number: 477 Selection: IMAGE_COMDAT_SELECT_ANY78 - Name: symbol79 Value: 080 SectionNumber: 381 SimpleType: IMAGE_SYM_TYPE_NULL82 ComplexType: IMAGE_SYM_DTYPE_NULL83 StorageClass: IMAGE_SYM_CLASS_EXTERNAL84 - Name: assocsym285 Value: 086 SectionNumber: 187 SimpleType: IMAGE_SYM_TYPE_NULL88 ComplexType: IMAGE_SYM_DTYPE_NULL89 StorageClass: IMAGE_SYM_CLASS_STATIC90 - Name: assocsym91 Value: 092 SectionNumber: 293 SimpleType: IMAGE_SYM_TYPE_NULL94 ComplexType: IMAGE_SYM_DTYPE_NULL95 StorageClass: IMAGE_SYM_CLASS_STATIC96...97 98