1@ RUN: llvm-mc -n -triple thumbv7-apple-darwin10 %s -filetype=obj -o %t.obj
2@ RUN: llvm-readobj -file-headers -s -sd -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols < %t.obj > %t.dump
3@ RUN: FileCheck < %t.dump %s
4
5	.syntax unified
6	.section	__TEXT,__text,regular,pure_instructions
7	.globl	_main
8	.align	2
9	.code	16
10	.thumb_func	_main
11_main:
12LPC0_0:
13	blx	_printf
14	.align	2
15LCPI0_0:
16	.long	L_.str-(LPC0_0+4)
17
18	.section	__TEXT,__cstring,cstring_literals
19	.align	2
20L_.str:
21	.asciz	 "s0"
22
23.subsections_via_symbols
24
25@ CHECK: File: <stdin>
26@ CHECK: Format: Mach-O arm
27@ CHECK: Arch: arm
28@ CHECK: AddressSize: 32bit
29@ CHECK: MachHeader {
30@ CHECK:   Magic: Magic (0xFEEDFACE)
31@ CHECK:   CpuType: Arm (0xC)
32@ CHECK:   CpuSubType: CPU_SUBTYPE_ARM_V7 (0x9)
33@ CHECK:   FileType: Relocatable (0x1)
34@ CHECK:   NumOfLoadCommands: 4
35@ CHECK:   SizeOfLoadCommands: 312
36@ CHECK:   Flags [ (0x2000)
37@ CHECK:     MH_SUBSECTIONS_VIA_SYMBOLS (0x2000)
38@ CHECK:   ]
39@ CHECK: }
40@ CHECK: Sections [
41@ CHECK:   Section {
42@ CHECK:     Index: 0
43@ CHECK:     Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
44@ CHECK:     Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
45@ CHECK:     Address: 0x0
46@ CHECK:     Size: 0x8
47@ CHECK:     Offset: 340
48@ CHECK:     Alignment: 2
49@ CHECK:     RelocationOffset: 0x160
50@ CHECK:     RelocationCount: 3
51@ CHECK:     Type: 0x0
52@ CHECK:     Attributes [ (0x800004)
53@ CHECK:       PureInstructions (0x800000)
54@ CHECK:       SomeInstructions (0x4)
55@ CHECK:     ]
56@ CHECK:     Reserved1: 0x0
57@ CHECK:     Reserved2: 0x0
58@ CHECK:     SectionData (
59@ CHECK:       0000: FFF7FEEF 04000000                    |........|
60@ CHECK:     )
61@ CHECK:   }
62@ CHECK:   Section {
63@ CHECK:     Index: 1
64@ CHECK:     Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
65@ CHECK:     Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
66@ CHECK:     Address: 0x8
67@ CHECK:     Size: 0x3
68@ CHECK:     Offset: 348
69@ CHECK:     Alignment: 2
70@ CHECK:     RelocationOffset: 0x0
71@ CHECK:     RelocationCount: 0
72@ CHECK:     Type: ExtReloc (0x2)
73@ CHECK:     Attributes [ (0x0)
74@ CHECK:     ]
75@ CHECK:     Reserved1: 0x0
76@ CHECK:     Reserved2: 0x0
77@ CHECK:     SectionData (
78@ CHECK:       0000: 733000                               |s0.|
79@ CHECK:     )
80@ CHECK:   }
81@ CHECK: ]
82@ CHECK: Relocations [
83@ CHECK:   Section __text {
84@ CHECK:     0x4 0 2 n/a ARM_RELOC_SECTDIFF 1 0x8
85@ CHECK:     0x0 0 2 n/a ARM_RELOC_PAIR 1 0x0
86@ CHECK:     0x0 1 2 1 ARM_THUMB_RELOC_BR22 0 _printf
87@ CHECK:   }
88@ CHECK: ]
89@ CHECK: Symbols [
90@ CHECK:   Symbol {
91@ CHECK:     Name: _main (1)
92@ CHECK:     Extern
93@ CHECK:     Type: Section (0xE)
94@ CHECK:     Section: __text (0x1)
95@ CHECK:     RefType: 0x8
96@ CHECK:     Flags [ (0x0)
97@ CHECK:     ]
98@ CHECK:     Value: 0x0
99@ CHECK:   }
100@ CHECK:   Symbol {
101@ CHECK:     Name: _printf (7)
102@ CHECK:     Extern
103@ CHECK:     Type: Undef (0x0)
104@ CHECK:     Section:  (0x0)
105@ CHECK:     RefType: UndefinedNonLazy (0x0)
106@ CHECK:     Flags [ (0x0)
107@ CHECK:     ]
108@ CHECK:     Value: 0x0
109@ CHECK:   }
110@ CHECK: ]
111@ CHECK: Indirect Symbols {
112@ CHECK:   Number: 0
113@ CHECK:   Symbols [
114@ CHECK:   ]
115@ CHECK: }
116@ CHECK: Segment {
117@ CHECK:   Cmd: LC_SEGMENT
118@ CHECK:   Name:
119@ CHECK:   Size: 192
120@ CHECK:   vmaddr: 0x0
121@ CHECK:   vmsize: 0xB
122@ CHECK:   fileoff: 340
123@ CHECK:   filesize: 11
124@ CHECK:   maxprot: rwx
125@ CHECK:   initprot: rwx
126@ CHECK:   nsects: 2
127@ CHECK:   flags: 0x0
128@ CHECK: }
129@ CHECK: Dysymtab {
130@ CHECK:   ilocalsym: 0
131@ CHECK:   nlocalsym: 0
132@ CHECK:   iextdefsym: 0
133@ CHECK:   nextdefsym: 1
134@ CHECK:   iundefsym: 1
135@ CHECK:   nundefsym: 1
136@ CHECK:   tocoff: 0
137@ CHECK:   ntoc: 0
138@ CHECK:   modtaboff: 0
139@ CHECK:   nmodtab: 0
140@ CHECK:   extrefsymoff: 0
141@ CHECK:   nextrefsyms: 0
142@ CHECK:   indirectsymoff: 0
143@ CHECK:   nindirectsyms: 0
144@ CHECK:   extreloff: 0
145@ CHECK:   nextrel: 0
146@ CHECK:   locreloff: 0
147@ CHECK:   nlocrel: 0
148@ CHECK: }
149