• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck -check-prefix CHECK-X86_32 %s
2// RUN: llvm-mc -triple x86_64-apple-darwin10 %s -filetype=obj -o - | macho-dump | FileCheck -check-prefix CHECK-X86_64 %s
3
4sym_local_B:
5.globl sym_globl_def_B
6.globl sym_globl_undef_B
7sym_local_A:
8.globl sym_globl_def_A
9.globl sym_globl_undef_A
10sym_local_C:
11.globl sym_globl_def_C
12.globl sym_globl_undef_C
13
14sym_globl_def_A:
15sym_globl_def_B:
16sym_globl_def_C:
17Lsym_asm_temp:
18        .long 0
19
20// CHECK-X86_32: ('cputype', 7)
21// CHECK-X86_32: ('cpusubtype', 3)
22// CHECK-X86_32: ('filetype', 1)
23// CHECK-X86_32: ('num_load_commands', 3)
24// CHECK-X86_32: ('load_commands_size', 228)
25// CHECK-X86_32: ('flag', 0)
26// CHECK-X86_32: ('load_commands', [
27// CHECK-X86_32:   # Load Command 0
28// CHECK-X86_32:  (('command', 1)
29// CHECK-X86_32:   ('size', 124)
30// CHECK-X86_32:   ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
31// CHECK-X86_32:   ('vm_addr', 0)
32// CHECK-X86_32:   ('vm_size', 4)
33// CHECK-X86_32:   ('file_offset', 256)
34// CHECK-X86_32:   ('file_size', 4)
35// CHECK-X86_32:   ('maxprot', 7)
36// CHECK-X86_32:   ('initprot', 7)
37// CHECK-X86_32:   ('num_sections', 1)
38// CHECK-X86_32:   ('flags', 0)
39// CHECK-X86_32:   ('sections', [
40// CHECK-X86_32:     # Section 0
41// CHECK-X86_32:    (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
42// CHECK-X86_32:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
43// CHECK-X86_32:     ('address', 0)
44// CHECK-X86_32:     ('size', 4)
45// CHECK-X86_32:     ('offset', 256)
46// CHECK-X86_32:     ('alignment', 0)
47// CHECK-X86_32:     ('reloc_offset', 0)
48// CHECK-X86_32:     ('num_reloc', 0)
49// CHECK-X86_32:     ('flags', 0x80000000)
50// CHECK-X86_32:     ('reserved1', 0)
51// CHECK-X86_32:     ('reserved2', 0)
52// CHECK-X86_32:    ),
53// CHECK-X86_32:   ])
54// CHECK-X86_32:  ),
55// CHECK-X86_32:   # Load Command 1
56// CHECK-X86_32:  (('command', 2)
57// CHECK-X86_32:   ('size', 24)
58// CHECK-X86_32:   ('symoff', 260)
59// CHECK-X86_32:   ('nsyms', 9)
60// CHECK-X86_32:   ('stroff', 368)
61// CHECK-X86_32:   ('strsize', 140)
62// CHECK-X86_32:   ('_string_data', '\x00sym_globl_def_B\x00sym_globl_undef_B\x00sym_globl_def_A\x00sym_globl_undef_A\x00sym_globl_def_C\x00sym_globl_undef_C\x00sym_local_B\x00sym_local_A\x00sym_local_C\x00\x00')
63// CHECK-X86_32:   ('_symbols', [
64// CHECK-X86_32:     # Symbol 0
65// CHECK-X86_32:    (('n_strx', 103)
66// CHECK-X86_32:     ('n_type', 0xe)
67// CHECK-X86_32:     ('n_sect', 1)
68// CHECK-X86_32:     ('n_desc', 0)
69// CHECK-X86_32:     ('n_value', 0)
70// CHECK-X86_32:     ('_string', 'sym_local_B')
71// CHECK-X86_32:    ),
72// CHECK-X86_32:     # Symbol 1
73// CHECK-X86_32:    (('n_strx', 115)
74// CHECK-X86_32:     ('n_type', 0xe)
75// CHECK-X86_32:     ('n_sect', 1)
76// CHECK-X86_32:     ('n_desc', 0)
77// CHECK-X86_32:     ('n_value', 0)
78// CHECK-X86_32:     ('_string', 'sym_local_A')
79// CHECK-X86_32:    ),
80// CHECK-X86_32:     # Symbol 2
81// CHECK-X86_32:    (('n_strx', 127)
82// CHECK-X86_32:     ('n_type', 0xe)
83// CHECK-X86_32:     ('n_sect', 1)
84// CHECK-X86_32:     ('n_desc', 0)
85// CHECK-X86_32:     ('n_value', 0)
86// CHECK-X86_32:     ('_string', 'sym_local_C')
87// CHECK-X86_32:    ),
88// CHECK-X86_32:     # Symbol 3
89// CHECK-X86_32:    (('n_strx', 35)
90// CHECK-X86_32:     ('n_type', 0xf)
91// CHECK-X86_32:     ('n_sect', 1)
92// CHECK-X86_32:     ('n_desc', 0)
93// CHECK-X86_32:     ('n_value', 0)
94// CHECK-X86_32:     ('_string', 'sym_globl_def_A')
95// CHECK-X86_32:    ),
96// CHECK-X86_32:     # Symbol 4
97// CHECK-X86_32:    (('n_strx', 1)
98// CHECK-X86_32:     ('n_type', 0xf)
99// CHECK-X86_32:     ('n_sect', 1)
100// CHECK-X86_32:     ('n_desc', 0)
101// CHECK-X86_32:     ('n_value', 0)
102// CHECK-X86_32:     ('_string', 'sym_globl_def_B')
103// CHECK-X86_32:    ),
104// CHECK-X86_32:     # Symbol 5
105// CHECK-X86_32:    (('n_strx', 69)
106// CHECK-X86_32:     ('n_type', 0xf)
107// CHECK-X86_32:     ('n_sect', 1)
108// CHECK-X86_32:     ('n_desc', 0)
109// CHECK-X86_32:     ('n_value', 0)
110// CHECK-X86_32:     ('_string', 'sym_globl_def_C')
111// CHECK-X86_32:    ),
112// CHECK-X86_32:     # Symbol 6
113// CHECK-X86_32:    (('n_strx', 51)
114// CHECK-X86_32:     ('n_type', 0x1)
115// CHECK-X86_32:     ('n_sect', 0)
116// CHECK-X86_32:     ('n_desc', 0)
117// CHECK-X86_32:     ('n_value', 0)
118// CHECK-X86_32:     ('_string', 'sym_globl_undef_A')
119// CHECK-X86_32:    ),
120// CHECK-X86_32:     # Symbol 7
121// CHECK-X86_32:    (('n_strx', 17)
122// CHECK-X86_32:     ('n_type', 0x1)
123// CHECK-X86_32:     ('n_sect', 0)
124// CHECK-X86_32:     ('n_desc', 0)
125// CHECK-X86_32:     ('n_value', 0)
126// CHECK-X86_32:     ('_string', 'sym_globl_undef_B')
127// CHECK-X86_32:    ),
128// CHECK-X86_32:     # Symbol 8
129// CHECK-X86_32:    (('n_strx', 85)
130// CHECK-X86_32:     ('n_type', 0x1)
131// CHECK-X86_32:     ('n_sect', 0)
132// CHECK-X86_32:     ('n_desc', 0)
133// CHECK-X86_32:     ('n_value', 0)
134// CHECK-X86_32:     ('_string', 'sym_globl_undef_C')
135// CHECK-X86_32:    ),
136// CHECK-X86_32:   ])
137// CHECK-X86_32:  ),
138// CHECK-X86_32:   # Load Command 2
139// CHECK-X86_32:  (('command', 11)
140// CHECK-X86_32:   ('size', 80)
141// CHECK-X86_32:   ('ilocalsym', 0)
142// CHECK-X86_32:   ('nlocalsym', 3)
143// CHECK-X86_32:   ('iextdefsym', 3)
144// CHECK-X86_32:   ('nextdefsym', 3)
145// CHECK-X86_32:   ('iundefsym', 6)
146// CHECK-X86_32:   ('nundefsym', 3)
147// CHECK-X86_32:   ('tocoff', 0)
148// CHECK-X86_32:   ('ntoc', 0)
149// CHECK-X86_32:   ('modtaboff', 0)
150// CHECK-X86_32:   ('nmodtab', 0)
151// CHECK-X86_32:   ('extrefsymoff', 0)
152// CHECK-X86_32:   ('nextrefsyms', 0)
153// CHECK-X86_32:   ('indirectsymoff', 0)
154// CHECK-X86_32:   ('nindirectsyms', 0)
155// CHECK-X86_32:   ('extreloff', 0)
156// CHECK-X86_32:   ('nextrel', 0)
157// CHECK-X86_32:   ('locreloff', 0)
158// CHECK-X86_32:   ('nlocrel', 0)
159// CHECK-X86_32:   ('_indirect_symbols', [
160// CHECK-X86_32:   ])
161// CHECK-X86_32:  ),
162// CHECK-X86_32: ])
163
164// CHECK-X86_64: ('cputype', 16777223)
165// CHECK-X86_64: ('cpusubtype', 3)
166// CHECK-X86_64: ('filetype', 1)
167// CHECK-X86_64: ('num_load_commands', 3)
168// CHECK-X86_64: ('load_commands_size', 256)
169// CHECK-X86_64: ('flag', 0)
170// CHECK-X86_64: ('reserved', 0)
171// CHECK-X86_64: ('load_commands', [
172// CHECK-X86_64:   # Load Command 0
173// CHECK-X86_64:  (('command', 25)
174// CHECK-X86_64:   ('size', 152)
175// CHECK-X86_64:   ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
176// CHECK-X86_64:   ('vm_addr', 0)
177// CHECK-X86_64:   ('vm_size', 4)
178// CHECK-X86_64:   ('file_offset', 288)
179// CHECK-X86_64:   ('file_size', 4)
180// CHECK-X86_64:   ('maxprot', 7)
181// CHECK-X86_64:   ('initprot', 7)
182// CHECK-X86_64:   ('num_sections', 1)
183// CHECK-X86_64:   ('flags', 0)
184// CHECK-X86_64:   ('sections', [
185// CHECK-X86_64:     # Section 0
186// CHECK-X86_64:    (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
187// CHECK-X86_64:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
188// CHECK-X86_64:     ('address', 0)
189// CHECK-X86_64:     ('size', 4)
190// CHECK-X86_64:     ('offset', 288)
191// CHECK-X86_64:     ('alignment', 0)
192// CHECK-X86_64:     ('reloc_offset', 0)
193// CHECK-X86_64:     ('num_reloc', 0)
194// CHECK-X86_64:     ('flags', 0x80000000)
195// CHECK-X86_64:     ('reserved1', 0)
196// CHECK-X86_64:     ('reserved2', 0)
197// CHECK-X86_64:     ('reserved3', 0)
198// CHECK-X86_64:    ),
199// CHECK-X86_64:   ('_relocations', [
200// CHECK-X86_64:   ])
201// CHECK-X86_64:   ])
202// CHECK-X86_64:  ),
203// CHECK-X86_64:   # Load Command 1
204// CHECK-X86_64:  (('command', 2)
205// CHECK-X86_64:   ('size', 24)
206// CHECK-X86_64:   ('symoff', 292)
207// CHECK-X86_64:   ('nsyms', 9)
208// CHECK-X86_64:   ('stroff', 436)
209// CHECK-X86_64:   ('strsize', 140)
210// CHECK-X86_64:   ('_string_data', '\x00sym_globl_def_B\x00sym_globl_undef_B\x00sym_globl_def_A\x00sym_globl_undef_A\x00sym_globl_def_C\x00sym_globl_undef_C\x00sym_local_B\x00sym_local_A\x00sym_local_C\x00\x00')
211// CHECK-X86_64:   ('_symbols', [
212// CHECK-X86_64:     # Symbol 0
213// CHECK-X86_64:    (('n_strx', 103)
214// CHECK-X86_64:     ('n_type', 0xe)
215// CHECK-X86_64:     ('n_sect', 1)
216// CHECK-X86_64:     ('n_desc', 0)
217// CHECK-X86_64:     ('n_value', 0)
218// CHECK-X86_64:     ('_string', 'sym_local_B')
219// CHECK-X86_64:    ),
220// CHECK-X86_64:     # Symbol 1
221// CHECK-X86_64:    (('n_strx', 115)
222// CHECK-X86_64:     ('n_type', 0xe)
223// CHECK-X86_64:     ('n_sect', 1)
224// CHECK-X86_64:     ('n_desc', 0)
225// CHECK-X86_64:     ('n_value', 0)
226// CHECK-X86_64:     ('_string', 'sym_local_A')
227// CHECK-X86_64:    ),
228// CHECK-X86_64:     # Symbol 2
229// CHECK-X86_64:    (('n_strx', 127)
230// CHECK-X86_64:     ('n_type', 0xe)
231// CHECK-X86_64:     ('n_sect', 1)
232// CHECK-X86_64:     ('n_desc', 0)
233// CHECK-X86_64:     ('n_value', 0)
234// CHECK-X86_64:     ('_string', 'sym_local_C')
235// CHECK-X86_64:    ),
236// CHECK-X86_64:     # Symbol 3
237// CHECK-X86_64:    (('n_strx', 35)
238// CHECK-X86_64:     ('n_type', 0xf)
239// CHECK-X86_64:     ('n_sect', 1)
240// CHECK-X86_64:     ('n_desc', 0)
241// CHECK-X86_64:     ('n_value', 0)
242// CHECK-X86_64:     ('_string', 'sym_globl_def_A')
243// CHECK-X86_64:    ),
244// CHECK-X86_64:     # Symbol 4
245// CHECK-X86_64:    (('n_strx', 1)
246// CHECK-X86_64:     ('n_type', 0xf)
247// CHECK-X86_64:     ('n_sect', 1)
248// CHECK-X86_64:     ('n_desc', 0)
249// CHECK-X86_64:     ('n_value', 0)
250// CHECK-X86_64:     ('_string', 'sym_globl_def_B')
251// CHECK-X86_64:    ),
252// CHECK-X86_64:     # Symbol 5
253// CHECK-X86_64:    (('n_strx', 69)
254// CHECK-X86_64:     ('n_type', 0xf)
255// CHECK-X86_64:     ('n_sect', 1)
256// CHECK-X86_64:     ('n_desc', 0)
257// CHECK-X86_64:     ('n_value', 0)
258// CHECK-X86_64:     ('_string', 'sym_globl_def_C')
259// CHECK-X86_64:    ),
260// CHECK-X86_64:     # Symbol 6
261// CHECK-X86_64:    (('n_strx', 51)
262// CHECK-X86_64:     ('n_type', 0x1)
263// CHECK-X86_64:     ('n_sect', 0)
264// CHECK-X86_64:     ('n_desc', 0)
265// CHECK-X86_64:     ('n_value', 0)
266// CHECK-X86_64:     ('_string', 'sym_globl_undef_A')
267// CHECK-X86_64:    ),
268// CHECK-X86_64:     # Symbol 7
269// CHECK-X86_64:    (('n_strx', 17)
270// CHECK-X86_64:     ('n_type', 0x1)
271// CHECK-X86_64:     ('n_sect', 0)
272// CHECK-X86_64:     ('n_desc', 0)
273// CHECK-X86_64:     ('n_value', 0)
274// CHECK-X86_64:     ('_string', 'sym_globl_undef_B')
275// CHECK-X86_64:    ),
276// CHECK-X86_64:     # Symbol 8
277// CHECK-X86_64:    (('n_strx', 85)
278// CHECK-X86_64:     ('n_type', 0x1)
279// CHECK-X86_64:     ('n_sect', 0)
280// CHECK-X86_64:     ('n_desc', 0)
281// CHECK-X86_64:     ('n_value', 0)
282// CHECK-X86_64:     ('_string', 'sym_globl_undef_C')
283// CHECK-X86_64:    ),
284// CHECK-X86_64:   ])
285// CHECK-X86_64:  ),
286// CHECK-X86_64:   # Load Command 2
287// CHECK-X86_64:  (('command', 11)
288// CHECK-X86_64:   ('size', 80)
289// CHECK-X86_64:   ('ilocalsym', 0)
290// CHECK-X86_64:   ('nlocalsym', 3)
291// CHECK-X86_64:   ('iextdefsym', 3)
292// CHECK-X86_64:   ('nextdefsym', 3)
293// CHECK-X86_64:   ('iundefsym', 6)
294// CHECK-X86_64:   ('nundefsym', 3)
295// CHECK-X86_64:   ('tocoff', 0)
296// CHECK-X86_64:   ('ntoc', 0)
297// CHECK-X86_64:   ('modtaboff', 0)
298// CHECK-X86_64:   ('nmodtab', 0)
299// CHECK-X86_64:   ('extrefsymoff', 0)
300// CHECK-X86_64:   ('nextrefsyms', 0)
301// CHECK-X86_64:   ('indirectsymoff', 0)
302// CHECK-X86_64:   ('nindirectsyms', 0)
303// CHECK-X86_64:   ('extreloff', 0)
304// CHECK-X86_64:   ('nextrel', 0)
305// CHECK-X86_64:   ('locreloff', 0)
306// CHECK-X86_64:   ('nlocrel', 0)
307// CHECK-X86_64:   ('_indirect_symbols', [
308// CHECK-X86_64:   ])
309// CHECK-X86_64:  ),
310// CHECK-X86_64: ])
311