1 // This test checks that the COFF object emitter works for the most basic
4 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -h -s -sr -sd -t | FileCheck %s
26 // CHECK: ImageFileHeader {
27 // CHECK: Machine: IMAGE_FILE_MACHINE_AMD64
28 // CHECK: SectionCount: 3
29 // CHECK: TimeDateStamp: {{[0-9]+}}
30 // CHECK: PointerToSymbolTable: 0x{{[0-9A-F]+}}
31 // CHECK: SymbolCount: 8
32 // CHECK: OptionalHeaderSize: 0
33 // CHECK: Characteristics [ (0x0)
38 // CHECK: Number: [[TextNum:[0-9]+]]
40 // CHECK: VirtualSize: 0
41 // CHECK: VirtualAddress: 0
42 // CHECK: RawDataSize: [[TextSize:[0-9]+]]
43 // CHECK: PointerToRawData: 0x{{[0-9A-F]+}}
44 // CHECK: PointerToRelocations: 0x{{[0-9A-F]+}}
45 // CHECK: PointerToLineNumbers: 0x0
46 // CHECK: RelocationCount: 2
47 // CHECK: LineNumberCount: 0
48 // CHECK: Characteristics [ (0x60500020)
49 // CHECK: IMAGE_SCN_ALIGN_16BYTES
50 // CHECK: IMAGE_SCN_CNT_CODE
51 // CHECK: IMAGE_SCN_MEM_EXECUTE
52 // CHECK: IMAGE_SCN_MEM_READ
54 // CHECK: Relocations [
55 // CHECK: 0x{{[0-9A-F]+}} IMAGE_REL_AMD64_ADDR32 .data
56 // CHECK: 0x{{[0-9A-F]+}} IMAGE_REL_AMD64_REL32 _printf
60 // CHECK: Number: [[DataNum:[0-9]+]]
62 // CHECK: VirtualSize: 0
63 // CHECK: VirtualAddress: 0
64 // CHECK: RawDataSize: [[DataSize:[0-9]+]]
65 // CHECK: PointerToRawData: 0x{{[0-9A-F]+}}
66 // CHECK: PointerToRelocations: 0x0
67 // CHECK: PointerToLineNumbers: 0x0
68 // CHECK: RelocationCount: 0
69 // CHECK: LineNumberCount: 0
70 // CHECK: Characteristics [ (0xC0300040)
71 // CHECK: IMAGE_SCN_ALIGN_4BYTES
72 // CHECK: IMAGE_SCN_CNT_INITIALIZED_DATA
73 // CHECK: IMAGE_SCN_MEM_READ
74 // CHECK: IMAGE_SCN_MEM_WRITE
76 // CHECK: Relocations [
78 // CHECK: SectionData (
79 // CHECK: 0000: 48656C6C 6F20576F 726C6400 |Hello World.|
87 // CHECK: Section: .text
88 // CHECK: BaseType: Null
89 // CHECK: ComplexType: Null
90 // CHECK: StorageClass: Static
91 // CHECK: AuxSymbolCount: 1
92 // CHECK: AuxSectionDef {
93 // CHECK: Length: [[TextSize]]
94 // CHECK: RelocationCount: 2
95 // CHECK: LineNumberCount: 0
96 // CHECK: Checksum: 0x8E1B6D20
97 // CHECK: Number: [[TextNum]]
98 // CHECK: Selection: 0x0
102 // CHECK: Name: .data
104 // CHECK: Section: .data
105 // CHECK: BaseType: Null
106 // CHECK: ComplexType: Null
107 // CHECK: StorageClass: Static
108 // CHECK: AuxSymbolCount: 1
109 // CHECK: AuxSectionDef {
110 // CHECK: Length: [[DataSize]]
111 // CHECK: RelocationCount: 0
112 // CHECK: LineNumberCount: 0
113 // CHECK: Checksum: 0x2B95CA92
114 // CHECK: Number: [[DataNum]]
115 // CHECK: Selection: 0x0
119 // CHECK: Name: _main
121 // CHECK: Section: .text
122 // CHECK: BaseType: Null
123 // CHECK: ComplexType: Function
124 // CHECK: StorageClass: External
125 // CHECK: AuxSymbolCount: 0
128 // CHECK: Name: _printf
130 // CHECK: Section: IMAGE_SYM_UNDEFINED (0)
131 // CHECK: BaseType: Null
132 // CHECK: ComplexType: Null
133 // CHECK: StorageClass: External
134 // CHECK: AuxSymbolCount: 0