1 # Tests that an associative comdat being associated with another
2 # associated comdat later in the file produces an error.
3 # RUN: sed -e s/ASSOC1/2/ -e s/ASSOC2/3/ %s | yaml2obj > %t.obj
4 # RUN: not lld-link /include:symbol /dll /noentry /nodefaultlib %t.obj /out:%t.exe 2>&1 | FileCheck --check-prefix=FORWARD %s
5 # 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:
8 # Tests that an associative comdat being associated with another
9 # associated comdat earlier in the file works.
10 # RUN: sed -e s/ASSOC1/3/ -e s/ASSOC2/1/ %s | yaml2obj > %t.obj
12 # RUN: lld-link /include:symbol /dll /noentry /nodefaultlib %t.obj /out:%t.exe
13 # RUN: llvm-objdump -s %t.exe | FileCheck --check-prefix=BACKWARD %s
14 # BACKWARD: Contents of section .text:
15 # BACKWARD: 180001000 01000000 02000000 03000000 ............
17 # RUN: lld-link /dll /noentry /nodefaultlib %t.obj /out:%t.exe
18 # RUN: llvm-objdump -s %t.exe | FileCheck --check-prefix=BACKWARDDROP %s
19 # BACKWARDDROP-NOT: Contents of section .text:
23 Machine: IMAGE_FILE_MACHINE_AMD64
27 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
29 SectionData: '01000000'
31 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
33 SectionData: '02000000'
35 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
37 SectionData: '03000000'
42 SimpleType: IMAGE_SYM_TYPE_NULL
43 ComplexType: IMAGE_SYM_DTYPE_NULL
44 StorageClass: IMAGE_SYM_CLASS_STATIC
47 NumberOfRelocations: 0
48 NumberOfLinenumbers: 0
51 Selection: IMAGE_COMDAT_SELECT_ASSOCIATIVE
55 SimpleType: IMAGE_SYM_TYPE_NULL
56 ComplexType: IMAGE_SYM_DTYPE_NULL
57 StorageClass: IMAGE_SYM_CLASS_STATIC
60 NumberOfRelocations: 0
61 NumberOfLinenumbers: 0
64 Selection: IMAGE_COMDAT_SELECT_ASSOCIATIVE
68 SimpleType: IMAGE_SYM_TYPE_NULL
69 ComplexType: IMAGE_SYM_DTYPE_NULL
70 StorageClass: IMAGE_SYM_CLASS_STATIC
73 NumberOfRelocations: 0
74 NumberOfLinenumbers: 0
77 Selection: IMAGE_COMDAT_SELECT_ANY
81 SimpleType: IMAGE_SYM_TYPE_NULL
82 ComplexType: IMAGE_SYM_DTYPE_NULL
83 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
87 SimpleType: IMAGE_SYM_TYPE_NULL
88 ComplexType: IMAGE_SYM_DTYPE_NULL
89 StorageClass: IMAGE_SYM_CLASS_STATIC
93 SimpleType: IMAGE_SYM_TYPE_NULL
94 ComplexType: IMAGE_SYM_DTYPE_NULL
95 StorageClass: IMAGE_SYM_CLASS_STATIC