1 // RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -file-headers -s -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols | FileCheck %s
3 // Note, this test intentionally mismatches Darwin 'as', which loses the
4 // following global marker.
6 // FIXME: We should probably warn about our interpretation of this.
8 .lcomm sym_lcomm_ext_A, 4
9 .lcomm sym_lcomm_ext_B, 4
10 .globl sym_lcomm_ext_B
12 .globl sym_zfill_ext_A
13 .zerofill __DATA, __bss, sym_zfill_ext_A, 4
14 .zerofill __DATA, __bss, sym_zfill_ext_B, 4
15 .globl sym_zfill_ext_B
17 // CHECK: File: <stdin>
18 // CHECK: Format: Mach-O 32-bit i386
20 // CHECK: AddressSize: 32bit
21 // CHECK: MachHeader {
22 // CHECK: Magic: Magic (0xFEEDFACE)
23 // CHECK: CpuType: X86 (0x7)
24 // CHECK: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3)
25 // CHECK: FileType: Relocatable (0x1)
26 // CHECK: NumOfLoadCommands: 4
27 // CHECK: SizeOfLoadCommands: 312
28 // CHECK: Flags [ (0x0)
34 // CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
35 // CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
36 // CHECK: Address: 0x0
39 // CHECK: Alignment: 0
40 // CHECK: RelocationOffset: 0x0
41 // CHECK: RelocationCount: 0
43 // CHECK: Attributes [ (0x800000)
44 // CHECK: PureInstructions (0x800000)
46 // CHECK: Reserved1: 0x0
47 // CHECK: Reserved2: 0x0
51 // CHECK: Name: __bss (5F 5F 62 73 73 00 00 00 00 00 00 00 00 00 00 00)
52 // CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
53 // CHECK: Address: 0x0
56 // CHECK: Alignment: 0
57 // CHECK: RelocationOffset: 0x0
58 // CHECK: RelocationCount: 0
59 // CHECK: Type: LocReloc (0x1)
60 // CHECK: Attributes [ (0x0)
62 // CHECK: Reserved1: 0x0
63 // CHECK: Reserved2: 0x0
66 // CHECK: Relocations [
70 // CHECK: Name: sym_lcomm_ext_A (33)
72 // CHECK: Type: Section (0xE)
73 // CHECK: Section: __bss (0x2)
74 // CHECK: RefType: UndefinedNonLazy (0x0)
75 // CHECK: Flags [ (0x0)
80 // CHECK: Name: sym_lcomm_ext_B (1)
82 // CHECK: Type: Section (0xE)
83 // CHECK: Section: __bss (0x2)
84 // CHECK: RefType: UndefinedNonLazy (0x0)
85 // CHECK: Flags [ (0x0)
90 // CHECK: Name: sym_zfill_ext_A (49)
92 // CHECK: Type: Section (0xE)
93 // CHECK: Section: __bss (0x2)
94 // CHECK: RefType: UndefinedNonLazy (0x0)
95 // CHECK: Flags [ (0x0)
100 // CHECK: Name: sym_zfill_ext_B (17)
102 // CHECK: Type: Section (0xE)
103 // CHECK: Section: __bss (0x2)
104 // CHECK: RefType: UndefinedNonLazy (0x0)
105 // CHECK: Flags [ (0x0)
110 // CHECK: Indirect Symbols {
116 // CHECK: Cmd: LC_SEGMENT
119 // CHECK: vmaddr: 0x0
120 // CHECK: vmsize: 0x10
121 // CHECK: fileoff: 340
122 // CHECK: filesize: 0
123 // CHECK: maxprot: rwx
124 // CHECK: initprot: rwx
129 // CHECK: ilocalsym: 0
130 // CHECK: nlocalsym: 0
131 // CHECK: iextdefsym: 0
132 // CHECK: nextdefsym: 4
133 // CHECK: iundefsym: 4
134 // CHECK: nundefsym: 0
137 // CHECK: modtaboff: 0
139 // CHECK: extrefsymoff: 0
140 // CHECK: nextrefsyms: 0
141 // CHECK: indirectsymoff: 0
142 // CHECK: nindirectsyms: 0
143 // CHECK: extreloff: 0
145 // CHECK: locreloff: 0