Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / COFF / include.test
blob8879ee5bd7a61b0c5f4a57f14c808afdd48b1d13
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 # CHECK1:     Discarded unused
13 # CHECK1-NOT: Discarded used
14 # CHECK2-NOT: Discarded unused
15 # CHECK2-NOT: Discarded used
17 --- !COFF
18 header:
19   Machine:         IMAGE_FILE_MACHINE_AMD64
20   Characteristics: []
21 sections:
22   - Name:            '.text$mn'
23     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
24     Alignment:       4
25     SectionData:     B82A000000C3
26   - Name:            '.text$mn'
27     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
28     Alignment:       4
29     SectionData:     B82A000000C3
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:            .drectve
35     Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
36     Alignment:       1
37     SectionData:     2f696e636c7564653a7573656400  # /include:used
38 symbols:
39   - Name:            '.text$mn'
40     Value:           0
41     SectionNumber:   1
42     SimpleType:      IMAGE_SYM_TYPE_NULL
43     ComplexType:     IMAGE_SYM_DTYPE_NULL
44     StorageClass:    IMAGE_SYM_CLASS_STATIC
45     SectionDefinition:
46       Length:          6
47       NumberOfRelocations: 0
48       NumberOfLinenumbers: 0
49       CheckSum:        0
50       Number:          0
51       Selection:       IMAGE_COMDAT_SELECT_ANY
52   - Name:            '.text$mn'
53     Value:           0
54     SectionNumber:   2
55     SimpleType:      IMAGE_SYM_TYPE_NULL
56     ComplexType:     IMAGE_SYM_DTYPE_NULL
57     StorageClass:    IMAGE_SYM_CLASS_STATIC
58     SectionDefinition:
59       Length:          6
60       NumberOfRelocations: 0
61       NumberOfLinenumbers: 0
62       CheckSum:        0
63       Number:          0
64       Selection:       IMAGE_COMDAT_SELECT_ANY
65   - Name:            '.text$mn'
66     Value:           0
67     SectionNumber:   3
68     SimpleType:      IMAGE_SYM_TYPE_NULL
69     ComplexType:     IMAGE_SYM_DTYPE_NULL
70     StorageClass:    IMAGE_SYM_CLASS_STATIC
71     SectionDefinition:
72       Length:          6
73       NumberOfRelocations: 0
74       NumberOfLinenumbers: 0
75       CheckSum:        0
76       Number:          0
77       Selection:       IMAGE_COMDAT_SELECT_ANY
78   - Name:            main
79     Value:           0
80     SectionNumber:   1
81     SimpleType:      IMAGE_SYM_TYPE_NULL
82     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
83     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
84   - Name:            used
85     Value:           0
86     SectionNumber:   2
87     SimpleType:      IMAGE_SYM_TYPE_NULL
88     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
89     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
90   - Name:            unused
91     Value:           0
92     SectionNumber:   3
93     SimpleType:      IMAGE_SYM_TYPE_NULL
94     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
95     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
96 ...