llvm-project
66 строк · 2.0 Кб
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
5
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
9
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
13
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
17
18# R: Characteristics [
19# R-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
20# R-NEXT: IMAGE_SCN_MEM_READ
21# R-NEXT: ]
22
23# W: Characteristics [
24# W-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
25# W-NEXT: IMAGE_SCN_MEM_WRITE
26# W-NEXT: ]
27
28# E: Characteristics [
29# E-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
30# E-NEXT: IMAGE_SCN_MEM_EXECUTE
31# E-NEXT: ]
32
33# S: Characteristics [
34# S-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
35# S-NEXT: IMAGE_SCN_MEM_SHARED
36# S-NEXT: ]
37
38--- !COFF
39header:
40Machine: IMAGE_FILE_MACHINE_AMD64
41Characteristics: []
42sections:
43- Name: .foo
44Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
45Alignment: 4
46SectionData: 000000000000
47symbols:
48- Name: .foo
49Value: 0
50SectionNumber: 1
51SimpleType: IMAGE_SYM_TYPE_NULL
52ComplexType: IMAGE_SYM_DTYPE_NULL
53StorageClass: IMAGE_SYM_CLASS_STATIC
54SectionDefinition:
55Length: 6
56NumberOfRelocations: 0
57NumberOfLinenumbers: 0
58CheckSum: 0
59Number: 0
60- Name: main
61Value: 0
62SectionNumber: 1
63SimpleType: IMAGE_SYM_TYPE_NULL
64ComplexType: IMAGE_SYM_DTYPE_FUNCTION
65StorageClass: IMAGE_SYM_CLASS_EXTERNAL
66...
67