Rename CODE_OWNERS -> Maintainers (#114544)
[llvm-project.git] / lld / test / COFF / include.test
blob2a8a8fe4034c4a8558a1ebecb84f1fd5e1d5693d
1 # RUN: yaml2obj %s -o %t.obj
3 # RUN: lld-link /out:%t.exe /entry:main %t.obj /verbose >& %t.log
4 ### FileCheck doesn't like empty input, so write something.
5 # RUN: echo dummy >> %t.log
6 # RUN: FileCheck -check-prefix=CHECK1 %s < %t.log
8 # RUN: lld-link /out:%t.exe /entry:main %t.obj /verbose /include:unused >& %t.log
9 # RUN: echo dummy >> %t.log
10 # RUN: FileCheck -check-prefix=CHECK2 %s < %t.log
12 # RUN: lld-link /out:%t.exe /entry:main %t.obj /verbose /includeglob:"glob_*" >& %t.log
13 # RUN: echo dummy >> %t.log
14 # RUN: FileCheck -check-prefix=CHECK3 %s < %t.log
16 # CHECK1:     Discarded unused
17 # CHECK1:     Discarded glob_match1
18 # CHECK1:     Discarded glob_match2
19 # CHECK1-NOT: Discarded used
20 # CHECK2-NOT: Discarded unused
21 # CHECK2-NOT: Discarded used
22 # CHECK3-NOT: Discarded glob_match1
23 # CHECK3-NOT: Discarded glob_match2
25 --- !COFF
26 header:
27   Machine:         IMAGE_FILE_MACHINE_AMD64
28   Characteristics: []
29 sections:
30   - Name:            '.text$mn'
31     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
32     Alignment:       4
33     SectionData:     B82A000000C3
34   - Name:            '.text$mn'
35     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
36     Alignment:       4
37     SectionData:     B82A000000C3
38   - Name:            '.text$mn'
39     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
40     Alignment:       4
41     SectionData:     B82A000000C3
42   - Name:            '.text$mn'
43     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
44     Alignment:       4
45     SectionData:     B82A000000C3
46   - Name:            '.text$mn'
47     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
48     Alignment:       4
49     SectionData:     B82A000000C3
50   - Name:            .drectve
51     Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
52     Alignment:       1
53     SectionData:     2f696e636c7564653a7573656400  # /include:used
54 symbols:
55   - Name:            '.text$mn'
56     Value:           0
57     SectionNumber:   1
58     SimpleType:      IMAGE_SYM_TYPE_NULL
59     ComplexType:     IMAGE_SYM_DTYPE_NULL
60     StorageClass:    IMAGE_SYM_CLASS_STATIC
61     SectionDefinition:
62       Length:          6
63       NumberOfRelocations: 0
64       NumberOfLinenumbers: 0
65       CheckSum:        0
66       Number:          0
67       Selection:       IMAGE_COMDAT_SELECT_ANY
68   - Name:            '.text$mn'
69     Value:           0
70     SectionNumber:   2
71     SimpleType:      IMAGE_SYM_TYPE_NULL
72     ComplexType:     IMAGE_SYM_DTYPE_NULL
73     StorageClass:    IMAGE_SYM_CLASS_STATIC
74     SectionDefinition:
75       Length:          6
76       NumberOfRelocations: 0
77       NumberOfLinenumbers: 0
78       CheckSum:        0
79       Number:          0
80       Selection:       IMAGE_COMDAT_SELECT_ANY
81   - Name:            '.text$mn'
82     Value:           0
83     SectionNumber:   3
84     SimpleType:      IMAGE_SYM_TYPE_NULL
85     ComplexType:     IMAGE_SYM_DTYPE_NULL
86     StorageClass:    IMAGE_SYM_CLASS_STATIC
87     SectionDefinition:
88       Length:          6
89       NumberOfRelocations: 0
90       NumberOfLinenumbers: 0
91       CheckSum:        0
92       Number:          0
93       Selection:       IMAGE_COMDAT_SELECT_ANY
94   - Name:            '.text$mn'
95     Value:           0
96     SectionNumber:   4
97     SimpleType:      IMAGE_SYM_TYPE_NULL
98     ComplexType:     IMAGE_SYM_DTYPE_NULL
99     StorageClass:    IMAGE_SYM_CLASS_STATIC
100     SectionDefinition:
101       Length:          6
102       NumberOfRelocations: 0
103       NumberOfLinenumbers: 0
104       CheckSum:        0
105       Number:          0
106       Selection:       IMAGE_COMDAT_SELECT_ANY
107   - Name:            '.text$mn'
108     Value:           0
109     SectionNumber:   5
110     SimpleType:      IMAGE_SYM_TYPE_NULL
111     ComplexType:     IMAGE_SYM_DTYPE_NULL
112     StorageClass:    IMAGE_SYM_CLASS_STATIC
113     SectionDefinition:
114       Length:          6
115       NumberOfRelocations: 0
116       NumberOfLinenumbers: 0
117       CheckSum:        0
118       Number:          0
119       Selection:       IMAGE_COMDAT_SELECT_ANY
120   - Name:            main
121     Value:           0
122     SectionNumber:   1
123     SimpleType:      IMAGE_SYM_TYPE_NULL
124     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
125     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
126   - Name:            used
127     Value:           0
128     SectionNumber:   2
129     SimpleType:      IMAGE_SYM_TYPE_NULL
130     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
131     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
132   - Name:            unused
133     Value:           0
134     SectionNumber:   3
135     SimpleType:      IMAGE_SYM_TYPE_NULL
136     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
137     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
138   - Name:            glob_match1
139     Value:           0
140     SectionNumber:   4
141     SimpleType:      IMAGE_SYM_TYPE_NULL
142     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
143     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
144   - Name:            glob_match2
145     Value:           0
146     SectionNumber:   5
147     SimpleType:      IMAGE_SYM_TYPE_NULL
148     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
149     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL