blob: e86ed8c6deb63f801e50fef08b055837a6688852 [file] [log] [blame]
Daniel Dunbar8fa9da22009-08-26 13:58:10 +00001// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
2
3 .data
4 .long undef
5 .long (undef + 4)
6
7 .globl local_a_ext
8local_a_ext:
9 .long local_a_ext
10
11local_a:
12 .long 0
13local_a_elt:
14 .long 0
15local_b:
16 .long local_b - local_c + 245
17 .long 0
18local_c:
19 .long 0
20
21
22 .long local_a_elt + 1
23 .long local_a_elt + 10
24 .short local_a_elt + 20
25 .byte local_a_elt + 89
26
27 .const
28
29 .long
30bar:
31 .long local_a_elt - bar + 33
32
33// CHECK: ('cputype', 7)
34// CHECK: ('cpusubtype', 3)
35// CHECK: ('filetype', 1)
36// CHECK: ('num_load_commands', 1)
37// CHECK: ('load_commands_size', 364)
38// CHECK: ('flag', 0)
39// CHECK: ('load_commands', [
40// CHECK: # Load Command 0
41// CHECK: (('command', 1)
42// CHECK: ('size', 260)
43// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
44// CHECK: ('vm_addr', 0)
45// CHECK: ('vm_size', 47)
46// CHECK: ('file_offset', 392)
47// CHECK: ('file_size', 47)
48// CHECK: ('maxprot', 7)
49// CHECK: ('initprot', 7)
50// CHECK: ('num_sections', 3)
51// CHECK: ('flags', 0)
52// CHECK: ('sections', [
53// CHECK: # Section 0
54// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
55// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
56// CHECK: ('address', 0)
57// CHECK: ('size', 0)
58// CHECK: ('offset', 392)
59// CHECK: ('alignment', 0)
60// CHECK: ('reloc_offset', 0)
61// CHECK: ('num_reloc', 0)
62// CHECK: ('flags', 0x80000000)
63// CHECK: ('reserved1', 0)
64// CHECK: ('reserved2', 0)
65// CHECK: ),
66// CHECK: ('_relocations', [
67// CHECK: ])
68// CHECK: ('_section_data', '')
69// CHECK: # Section 1
70// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
71// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
72// CHECK: ('address', 0)
73// CHECK: ('size', 43)
74// CHECK: ('offset', 392)
75// CHECK: ('alignment', 0)
76// CHECK: ('reloc_offset', 440)
77// CHECK: ('num_reloc', 9)
78// CHECK: ('flags', 0x0)
79// CHECK: ('reserved1', 0)
80// CHECK: ('reserved2', 0)
81// CHECK: ),
82// CHECK: ('_relocations', [
83// CHECK: # Relocation 0
84// CHECK: (('word-0', 0x8000002a),
85// CHECK: ('word-1', 0x10)),
86// CHECK: # Relocation 1
87// CHECK: (('word-0', 0x90000028),
88// CHECK: ('word-1', 0x10)),
89// CHECK: # Relocation 2
90// CHECK: (('word-0', 0xa0000024),
91// CHECK: ('word-1', 0x10)),
92// CHECK: # Relocation 3
93// CHECK: (('word-0', 0xa0000020),
94// CHECK: ('word-1', 0x10)),
95// CHECK: # Relocation 4
96// CHECK: (('word-0', 0xa4000014),
97// CHECK: ('word-1', 0x14)),
98// CHECK: # Relocation 5
99// CHECK: (('word-0', 0xa1000000),
100// CHECK: ('word-1', 0x1c)),
101// CHECK: # Relocation 6
102// CHECK: (('word-0', 0x8),
103// CHECK: ('word-1', 0x4000002)),
104// CHECK: # Relocation 7
105// CHECK: (('word-0', 0x4),
106// CHECK: ('word-1', 0xc000006)),
107// CHECK: # Relocation 8
108// CHECK: (('word-0', 0x0),
109// CHECK: ('word-1', 0xc000006)),
110// CHECK: ])
111// CHECK: ('_section_data', '\x00\x00\x00\x00\x04\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xed\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x1a\x00\x00\x00$\x00i')
112// CHECK: # Section 2
113// CHECK: (('section_name', '__const\x00\x00\x00\x00\x00\x00\x00\x00\x00')
114// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
115// CHECK: ('address', 43)
116// CHECK: ('size', 4)
117// CHECK: ('offset', 435)
118// CHECK: ('alignment', 0)
119// CHECK: ('reloc_offset', 512)
120// CHECK: ('num_reloc', 2)
121// CHECK: ('flags', 0x0)
122// CHECK: ('reserved1', 0)
123// CHECK: ('reserved2', 0)
124// CHECK: ),
125// CHECK: ('_relocations', [
126// CHECK: # Relocation 0
127// CHECK: (('word-0', 0xa4000000),
128// CHECK: ('word-1', 0x10)),
129// CHECK: # Relocation 1
130// CHECK: (('word-0', 0xa1000000),
131// CHECK: ('word-1', 0x2b)),
132// CHECK: ])
133// CHECK: ('_section_data', '\x06\x00\x00\x00')
134// CHECK: ])
135// CHECK: ),
136// CHECK: # Load Command 1
137// CHECK: (('command', 2)
138// CHECK: ('size', 24)
139// CHECK: ('symoff', 528)
140// CHECK: ('nsyms', 7)
141// CHECK: ('stroff', 612)
142// CHECK: ('strsize', 60)
143// CHECK: ('_string_data', '\x00undef\x00local_a_ext\x00local_a\x00local_a_elt\x00local_b\x00local_c\x00bar\x00\x00')
144// CHECK: ('_symbols', [
145// CHECK: # Symbol 0
146// CHECK: (('n_strx', 19)
147// CHECK: ('n_type', 0xe)
148// CHECK: ('n_sect', 2)
149// CHECK: ('n_desc', 0)
150// CHECK: ('n_value', 12)
151// CHECK: ('_string', 'local_a')
152// CHECK: ),
153// CHECK: # Symbol 1
154// CHECK: (('n_strx', 27)
155// CHECK: ('n_type', 0xe)
156// CHECK: ('n_sect', 2)
157// CHECK: ('n_desc', 0)
158// CHECK: ('n_value', 16)
159// CHECK: ('_string', 'local_a_elt')
160// CHECK: ),
161// CHECK: # Symbol 2
162// CHECK: (('n_strx', 39)
163// CHECK: ('n_type', 0xe)
164// CHECK: ('n_sect', 2)
165// CHECK: ('n_desc', 0)
166// CHECK: ('n_value', 20)
167// CHECK: ('_string', 'local_b')
168// CHECK: ),
169// CHECK: # Symbol 3
170// CHECK: (('n_strx', 47)
171// CHECK: ('n_type', 0xe)
172// CHECK: ('n_sect', 2)
173// CHECK: ('n_desc', 0)
174// CHECK: ('n_value', 28)
175// CHECK: ('_string', 'local_c')
176// CHECK: ),
177// CHECK: # Symbol 4
178// CHECK: (('n_strx', 55)
179// CHECK: ('n_type', 0xe)
180// CHECK: ('n_sect', 3)
181// CHECK: ('n_desc', 0)
182// CHECK: ('n_value', 43)
183// CHECK: ('_string', 'bar')
184// CHECK: ),
185// CHECK: # Symbol 5
186// CHECK: (('n_strx', 7)
187// CHECK: ('n_type', 0xf)
188// CHECK: ('n_sect', 2)
189// CHECK: ('n_desc', 0)
190// CHECK: ('n_value', 8)
191// CHECK: ('_string', 'local_a_ext')
192// CHECK: ),
193// CHECK: # Symbol 6
194// CHECK: (('n_strx', 1)
195// CHECK: ('n_type', 0x1)
196// CHECK: ('n_sect', 0)
197// CHECK: ('n_desc', 0)
198// CHECK: ('n_value', 0)
199// CHECK: ('_string', 'undef')
200// CHECK: ),
201// CHECK: ])
202// CHECK: ),
203// CHECK: # Load Command 2
204// CHECK: (('command', 11)
205// CHECK: ('size', 80)
206// CHECK: ('ilocalsym', 0)
207// CHECK: ('nlocalsym', 5)
208// CHECK: ('iextdefsym', 5)
209// CHECK: ('nextdefsym', 1)
210// CHECK: ('iundefsym', 6)
211// CHECK: ('nundefsym', 1)
212// CHECK: ('tocoff', 0)
213// CHECK: ('ntoc', 0)
214// CHECK: ('modtaboff', 0)
215// CHECK: ('nmodtab', 0)
216// CHECK: ('extrefsymoff', 0)
217// CHECK: ('nextrefsyms', 0)
218// CHECK: ('indirectsymoff', 0)
219// CHECK: ('nindirectsyms', 0)
220// CHECK: ('extreloff', 0)
221// CHECK: ('nextrel', 0)
222// CHECK: ('locreloff', 0)
223// CHECK: ('nlocrel', 0)
224// CHECK: ('_indirect_symbols', [
225// CHECK: ])
226// CHECK: ),
227// CHECK: ])