[LLD][COFF] Fix TypeServerSource matcher with more than one collision
[llvm-project.git] / lld / test / COFF / icf-associative.test
blobef7517afd47485cbcdeec349226a9aa9d487f11a
1 # RUN: yaml2obj %s -o %t.obj
2 # RUN: lld-link /opt:icf /entry:foo /out:%t.exe /subsystem:console /include:bar \
3 # RUN:   /debug /verbose %t.obj > %t.log 2>&1
4 # RUN: FileCheck %s < %t.log
6 # CHECK: Selected foo
7 # CHECK:   Removed bar
9 --- !COFF
10 header:
11   Machine:         IMAGE_FILE_MACHINE_AMD64
12   Characteristics: []
13 sections:
14   - Name:            '.text$mn'
15     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
16     Alignment:       16
17     SectionData:     4883EC28E8000000004883C428C3
19   - Name:            '.debug_blah'
20     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
21     Alignment:       1
22     SectionData:     0000000000000000000000000000
24   - Name:            '.text$mn'
25     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
26     Alignment:       16
27     SectionData:     4883EC28E8000000004883C428C3
29   - Name:            '.debug_blah'
30     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
31     Alignment:       1
32     SectionData:     FFFFFFFFFFFFFFFFFFFFFFFFFFFF
34 symbols:
35   - Name:            '.text$mn'
36     Value:           0
37     SectionNumber:   1
38     SimpleType:      IMAGE_SYM_TYPE_NULL
39     ComplexType:     IMAGE_SYM_DTYPE_NULL
40     StorageClass:    IMAGE_SYM_CLASS_STATIC
41     SectionDefinition:
42       Length:          14
43       NumberOfRelocations: 0
44       NumberOfLinenumbers: 0
45       CheckSum:        1682752513
46       Number:          0
47       Selection:       IMAGE_COMDAT_SELECT_ANY
49   - Name:            '.debug_blah'
50     Value:           0
51     SectionNumber:   2
52     SimpleType:      IMAGE_SYM_TYPE_NULL
53     ComplexType:     IMAGE_SYM_DTYPE_NULL
54     StorageClass:    IMAGE_SYM_CLASS_STATIC
55     SectionDefinition:
56       Length:          14
57       NumberOfRelocations: 0
58       NumberOfLinenumbers: 0
59       CheckSum:        0
60       Number:          1
61       Selection:       IMAGE_COMDAT_SELECT_ASSOCIATIVE
63   - Name:            '.text$mn'
64     Value:           0
65     SectionNumber:   3
66     SimpleType:      IMAGE_SYM_TYPE_NULL
67     ComplexType:     IMAGE_SYM_DTYPE_NULL
68     StorageClass:    IMAGE_SYM_CLASS_STATIC
69     SectionDefinition:
70       Length:          14
71       NumberOfRelocations: 0
72       NumberOfLinenumbers: 0
73       CheckSum:        1682752513
74       Number:          0
75       Selection:       IMAGE_COMDAT_SELECT_ANY
77   - Name:            '.debug_blah'
78     Value:           0
79     SectionNumber:   4
80     SimpleType:      IMAGE_SYM_TYPE_NULL
81     ComplexType:     IMAGE_SYM_DTYPE_NULL
82     StorageClass:    IMAGE_SYM_CLASS_STATIC
83     SectionDefinition:
84       Length:          14
85       NumberOfRelocations: 0
86       NumberOfLinenumbers: 0
87       CheckSum:        0
88       Number:          3
89       Selection:       IMAGE_COMDAT_SELECT_ASSOCIATIVE
91   - Name:            foo
92     Value:           0
93     SectionNumber:   1
94     SimpleType:      IMAGE_SYM_TYPE_NULL
95     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
96     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
98   - Name:            bar
99     Value:           0
100     SectionNumber:   3
101     SimpleType:      IMAGE_SYM_TYPE_NULL
102     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
103     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL