Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / COFF / section.test
blobe153a778281cdbd4949a75d82242cf0c7c01b6c9
1 # RUN: yaml2obj %s -o %t.obj
2 # RUN: lld-link /out:%t.exe /entry:main /subsystem:console /force \
3 # RUN:   /section:.foo,r %t.obj
4 # RUN: llvm-readobj --sections %t.exe | FileCheck -check-prefix=R %s
6 # RUN: lld-link /out:%t.exe /entry:main /subsystem:console /force \
7 # RUN:   /section:.foo,w %t.obj
8 # RUN: llvm-readobj --sections %t.exe | FileCheck -check-prefix=W %s
10 # RUN: lld-link /out:%t.exe /entry:main /subsystem:console /force \
11 # RUN:   /section:.foo,e %t.obj
12 # RUN: llvm-readobj --sections %t.exe | FileCheck -check-prefix=E %s
14 # RUN: lld-link /out:%t.exe /entry:main /subsystem:console /force \
15 # RUN:   /section:.foo,s %t.obj
16 # RUN: llvm-readobj --sections %t.exe | FileCheck -check-prefix=S %s
18 # R:      Characteristics [
19 # R-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA
20 # R-NEXT:   IMAGE_SCN_MEM_READ
21 # R-NEXT: ]
23 # W:      Characteristics [
24 # W-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA
25 # W-NEXT:   IMAGE_SCN_MEM_WRITE
26 # W-NEXT: ]
28 # E:      Characteristics [
29 # E-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA
30 # E-NEXT:   IMAGE_SCN_MEM_EXECUTE
31 # E-NEXT: ]
33 # S:      Characteristics [
34 # S-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA
35 # S-NEXT:   IMAGE_SCN_MEM_SHARED
36 # S-NEXT: ]
38 --- !COFF
39 header:
40   Machine:         IMAGE_FILE_MACHINE_AMD64
41   Characteristics: []
42 sections:
43   - Name:            .foo
44     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
45     Alignment:       4
46     SectionData:     000000000000
47 symbols:
48   - Name:            .foo
49     Value:           0
50     SectionNumber:   1
51     SimpleType:      IMAGE_SYM_TYPE_NULL
52     ComplexType:     IMAGE_SYM_DTYPE_NULL
53     StorageClass:    IMAGE_SYM_CLASS_STATIC
54     SectionDefinition:
55       Length:          6
56       NumberOfRelocations: 0
57       NumberOfLinenumbers: 0
58       CheckSum:        0
59       Number:          0
60   - Name:            main
61     Value:           0
62     SectionNumber:   1
63     SimpleType:      IMAGE_SYM_TYPE_NULL
64     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
65     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
66 ...