1# RUN: yaml2obj %s | obj2yaml | FileCheck %s
2
3--- !mach-o
4FileHeader:      
5  magic:           0xFEEDFACF
6  cputype:         0x01000007
7  cpusubtype:      0x00000003
8  filetype:        0x0000000A
9  ncmds:           5
10  sizeofcmds:      1800
11  flags:           0x00000000
12  reserved:        0x00000000
13LoadCommands:    
14  - cmd:             LC_SEGMENT_64
15    cmdsize:         72
16    segname:         __PAGEZERO
17    vmaddr:          0
18    vmsize:          4294967296
19    fileoff:         0
20    filesize:        0
21    maxprot:         0
22    initprot:        0
23    nsects:          0
24    flags:           0
25  - cmd:             LC_SEGMENT_64
26    cmdsize:         472
27    segname:         __TEXT
28    vmaddr:          4294967296
29    vmsize:          4096
30    fileoff:         0
31    filesize:        0
32    maxprot:         7
33    initprot:        5
34    nsects:          5
35    flags:           0
36    Sections:        
37      - sectname:        __text
38        segname:         __TEXT
39        addr:            0x0000000100000F50
40        size:            52
41        offset:          0x00000000
42        align:           4
43        reloff:          0x00000000
44        nreloc:          0
45        flags:           0x80000400
46        reserved1:       0x00000000
47        reserved2:       0x00000000
48        reserved3:       0x00000000
49      - sectname:        __stubs
50        segname:         __TEXT
51        addr:            0x0000000100000F84
52        size:            6
53        offset:          0x00000000
54        align:           1
55        reloff:          0x00000000
56        nreloc:          0
57        flags:           0x80000408
58        reserved1:       0x00000000
59        reserved2:       0x00000006
60        reserved3:       0x00000000
61      - sectname:        __stub_helper
62        segname:         __TEXT
63        addr:            0x0000000100000F8C
64        size:            26
65        offset:          0x00000000
66        align:           2
67        reloff:          0x00000000
68        nreloc:          0
69        flags:           0x80000400
70        reserved1:       0x00000000
71        reserved2:       0x00000000
72        reserved3:       0x00000000
73      - sectname:        __cstring
74        segname:         __TEXT
75        addr:            0x0000000100000FA6
76        size:            14
77        offset:          0x00000000
78        align:           0
79        reloff:          0x00000000
80        nreloc:          0
81        flags:           0x00000002
82        reserved1:       0x00000000
83        reserved2:       0x00000000
84        reserved3:       0x00000000
85      - sectname:        __unwind_info
86        segname:         __TEXT
87        addr:            0x0000000100000FB4
88        size:            72
89        offset:          0x00000000
90        align:           2
91        reloff:          0x00000000
92        nreloc:          0
93        flags:           0x00000000
94        reserved1:       0x00000000
95        reserved2:       0x00000000
96        reserved3:       0x00000000
97  - cmd:             LC_SEGMENT_64
98    cmdsize:         232
99    segname:         __DATA
100    vmaddr:          4294971392
101    vmsize:          4096
102    fileoff:         0
103    filesize:        0
104    maxprot:         7
105    initprot:        3
106    nsects:          2
107    flags:           0
108    Sections:        
109      - sectname:        __nl_symbol_ptr
110        segname:         __DATA
111        addr:            0x0000000100001000
112        size:            16
113        offset:          0x00000000
114        align:           3
115        reloff:          0x00000000
116        nreloc:          0
117        flags:           0x00000006
118        reserved1:       0x00000001
119        reserved2:       0x00000000
120        reserved3:       0x00000000
121      - sectname:        __la_symbol_ptr
122        segname:         __DATA
123        addr:            0x0000000100001010
124        size:            8
125        offset:          0x00000000
126        align:           3
127        reloff:          0x00000000
128        nreloc:          0
129        flags:           0x00000007
130        reserved1:       0x00000003
131        reserved2:       0x00000000
132        reserved3:       0x00000000
133  - cmd:             LC_SEGMENT_64
134    cmdsize:         72
135    segname:         __LINKEDIT
136    vmaddr:          4294975488
137    vmsize:          4096
138    fileoff:         4096
139    filesize:        60
140    maxprot:         7
141    initprot:        1
142    nsects:          0
143    flags:           0
144  - cmd:             LC_SEGMENT_64
145    cmdsize:         952
146    segname:         __DWARF
147    vmaddr:          4294979584
148    vmsize:          4096
149    fileoff:         8192
150    filesize:        764
151    maxprot:         7
152    initprot:        3
153    nsects:          11
154    flags:           0
155    Sections:        
156      - sectname:        __debug_line
157        segname:         __DWARF
158        addr:            0x0000000100003000
159        size:            69
160        offset:          0x00002000
161        align:           0
162        reloff:          0x00000000
163        nreloc:          0
164        flags:           0x00000000
165        reserved1:       0x00000000
166        reserved2:       0x00000000
167        reserved3:       0x00000000
168      - sectname:        __debug_pubnames
169        segname:         __DWARF
170        addr:            0x0000000100003045
171        size:            27
172        offset:          0x00002045
173        align:           0
174        reloff:          0x00000000
175        nreloc:          0
176        flags:           0x00000000
177        reserved1:       0x00000000
178        reserved2:       0x00000000
179        reserved3:       0x00000000
180      - sectname:        __debug_pubtypes
181        segname:         __DWARF
182        addr:            0x0000000100003060
183        size:            35
184        offset:          0x00002060
185        align:           0
186        reloff:          0x00000000
187        nreloc:          0
188        flags:           0x00000000
189        reserved1:       0x00000000
190        reserved2:       0x00000000
191        reserved3:       0x00000000
192      - sectname:        __debug_info
193        segname:         __DWARF
194        addr:            0x00000001000030B3
195        size:            180
196        offset:          0x000020B3
197        align:           0
198        reloff:          0x00000000
199        nreloc:          0
200        flags:           0x00000000
201        reserved1:       0x00000000
202        reserved2:       0x00000000
203        reserved3:       0x00000000
204      - sectname:        __debug_abbrev
205        segname:         __DWARF
206        addr:            0x000000010000312C
207        size:            86
208        offset:          0x00002167
209        align:           0
210        reloff:          0x00000000
211        nreloc:          0
212        flags:           0x00000000
213        reserved1:       0x00000000
214        reserved2:       0x00000000
215        reserved3:       0x00000000
216      - sectname:        __debug_str
217        segname:         __DWARF
218        addr:            0x0000000100003178
219        size:            83
220        offset:          0x000021BC
221        align:           0
222        reloff:          0x00000000
223        nreloc:          0
224        flags:           0x00000000
225        reserved1:       0x00000000
226        reserved2:       0x00000000
227        reserved3:       0x00000000
228      - sectname:        __apple_names
229        segname:         __DWARF
230        addr:            0x0000000100003206
231        size:            36
232        offset:          0x0000221E
233        align:           0
234        reloff:          0x00000000
235        nreloc:          0
236        flags:           0x00000000
237        reserved1:       0x00000000
238        reserved2:       0x00000000
239        reserved3:       0x00000000
240      - sectname:        __apple_namespac
241        segname:         __DWARF
242        addr:            0x0000000100003242
243        size:            36
244        offset:          0x00002242
245        align:           0
246        reloff:          0x00000000
247        nreloc:          0
248        flags:           0x00000000
249        reserved1:       0x00000000
250        reserved2:       0x00000000
251        reserved3:       0x00000000
252      - sectname:        __apple_types
253        segname:         __DWARF
254        addr:            0x0000000100003266
255        size:            114
256        offset:          0x00002266
257        align:           0
258        reloff:          0x00000000
259        nreloc:          0
260        flags:           0x00000000
261        reserved1:       0x00000000
262        reserved2:       0x00000000
263        reserved3:       0x00000000
264      - sectname:        __apple_objc
265        segname:         __DWARF
266        addr:            0x00000001000032D8
267        size:            36
268        offset:          0x000022D8
269        align:           0
270        reloff:          0x00000000
271        nreloc:          0
272        flags:           0x00000000
273        reserved1:       0x00000000
274        reserved2:       0x00000000
275        reserved3:       0x00000000
276DWARF:
277  debug_str:       
278    - World
279  debug_abbrev:
280    - Table:
281        - Code:            0x00000001
282          Tag:             DW_TAG_compile_unit
283          Children:        DW_CHILDREN_no
284          Attributes:
285            - Attribute:       0x2000
286              Form:            DW_FORM_addr
287            - Attribute:       0x2001
288              Form:            DW_FORM_block
289            - Attribute:       DW_AT_MIPS_loop_begin
290              Form:            DW_FORM_block1
291            - Attribute:       DW_AT_MIPS_tail_loop_begin
292              Form:            DW_FORM_block2
293            - Attribute:       DW_AT_MIPS_epilog_begin
294              Form:            DW_FORM_block4
295            - Attribute:       DW_AT_MIPS_loop_unroll_factor
296              Form:            DW_FORM_data1
297            - Attribute:       DW_AT_MIPS_software_pipeline_depth
298              Form:            DW_FORM_data2
299            - Attribute:       DW_AT_MIPS_linkage_name
300              Form:            DW_FORM_data4
301            - Attribute:       DW_AT_MIPS_stride
302              Form:            DW_FORM_data8
303            - Attribute:       DW_AT_MIPS_abstract_name
304              Form:            DW_FORM_string
305            - Attribute:       DW_AT_MIPS_clone_origin
306              Form:            DW_FORM_strp
307            - Attribute:       DW_AT_MIPS_has_inlines
308              Form:            DW_FORM_ref_addr
309            - Attribute:       DW_AT_MIPS_stride_byte
310              Form:            DW_FORM_ref1
311            - Attribute:       DW_AT_MIPS_stride_elem
312              Form:            DW_FORM_ref2
313            - Attribute:       DW_AT_MIPS_ptr_dopetype
314              Form:            DW_FORM_ref4
315            - Attribute:       DW_AT_MIPS_allocatable_dopetype
316              Form:            DW_FORM_ref8
317            - Attribute:       DW_AT_MIPS_assumed_shape_dopetype
318              Form:            DW_FORM_ref_sig8
319            - Attribute:       DW_AT_MIPS_assumed_size
320              Form:            DW_FORM_ref_udata
321            - Attribute:       0x2012
322              Form:            DW_FORM_flag
323            - Attribute:       0x2013
324              Form:            DW_FORM_flag
325            - Attribute:       0x2014
326              Form:            DW_FORM_flag_present
327            - Attribute:       0x2015
328              Form:            DW_FORM_sdata
329            - Attribute:       0x2017
330              Form:            DW_FORM_udata
331            - Attribute:       0x2018
332              Form:            DW_FORM_GNU_ref_alt
333            - Attribute:       0x2019
334              Form:            DW_FORM_sec_offset
335            - Attribute:       0x201A
336              Form:            DW_FORM_addr
337  debug_info:      
338    - Length:          168
339      Version:         2
340      AbbrOffset:      0
341      AddrSize:        8
342      Entries:         
343        - AbbrCode:        0x00000001
344          Values:          
345            - Value:           0x0123456789ABCDEF
346            - Value:           0x000000000000000A
347              BlockData:       
348                - 0x01
349                - 0x02
350                - 0x03
351                - 0x04
352                - 0x05
353                - 0x06
354                - 0x07
355                - 0x08
356                - 0x09
357                - 0x00
358            - Value:           0x000000000000000A
359              BlockData:       
360                - 0x01
361                - 0x02
362                - 0x03
363                - 0x04
364                - 0x05
365                - 0x06
366                - 0x07
367                - 0x08
368                - 0x09
369                - 0x00
370            - Value:           0x000000000000000A
371              BlockData:       
372                - 0x01
373                - 0x02
374                - 0x03
375                - 0x04
376                - 0x05
377                - 0x06
378                - 0x07
379                - 0x08
380                - 0x09
381                - 0x00
382            - Value:           0x000000000000000A
383              BlockData:       
384                - 0x01
385                - 0x02
386                - 0x03
387                - 0x04
388                - 0x05
389                - 0x06
390                - 0x07
391                - 0x08
392                - 0x09
393                - 0x00
394            - Value:           0x0000000000000001
395            - Value:           0x0000000000002345
396            - Value:           0x000000006789ABCD
397            - Value:           0x0011223344556677
398            - Value:           0x0000000000000000
399              CStr:            Hello
400            - Value:           0x0000000000000000
401            - Value:           0x0000000012345678
402            - Value:           0x0000000000000001
403            - Value:           0x0000000000002345
404            - Value:           0x000000006789ABCD
405            - Value:           0x0011223344556677
406            - Value:           0xAABBCCDDEEFF0011
407            - Value:           0xFFFFFFFFFFFFFFFE
408            - Value:           0x0000000000000001
409            - Value:           0x0000000000000000
410            - Value:           0x0000000000000001
411            - Value:           0x8000000000000000
412            - Value:           0xFFFFFFFFFFFFFFFE
413            - Value:           0x0000000000000001
414            - Value:           0x0000000000000002
415            - Value:           0x0123456789ABCDEF
416...
417
418#CHECK:   debug_info:
419#CHECK:     - Length:          0xA8
420#CHECK:       Version:         2
421#CHECK:       AbbrOffset:      0
422#CHECK:       AddrSize:        8
423#CHECK:       Entries:
424#CHECK:         - AbbrCode:        0x1
425#CHECK:           Values:
426#CHECK:             - Value:           0x123456789ABCDEF
427#CHECK:             - Value:           0xA
428#CHECK:               BlockData:       [ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
429#CHECK:                                  0x9, 0x0 ]
430#CHECK:             - Value:           0xA
431#CHECK:               BlockData:       [ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
432#CHECK:                                  0x9, 0x0 ]
433#CHECK:             - Value:           0xA
434#CHECK:               BlockData:       [ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
435#CHECK:                                  0x9, 0x0 ]
436#CHECK:             - Value:           0xA
437#CHECK:               BlockData:       [ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
438#CHECK:                                  0x9, 0x0 ]
439#CHECK:             - Value:           0x1
440#CHECK:             - Value:           0x2345
441#CHECK:             - Value:           0x6789ABCD
442#CHECK:             - Value:           0x11223344556677
443#CHECK:               CStr:            Hello
444#CHECK:             - Value:           0x0
445#CHECK:             - Value:           0x12345678
446#CHECK:             - Value:           0x1
447#CHECK:             - Value:           0x2345
448#CHECK:             - Value:           0x6789ABCD
449#CHECK:             - Value:           0x11223344556677
450#CHECK:             - Value:           0xAABBCCDDEEFF0011
451#CHECK:             - Value:           0xFFFFFFFFFFFFFFFE
452#CHECK:             - Value:           0x1
453#CHECK:             - Value:           0x0
454#CHECK:             - Value:           0x1
455#CHECK:             - Value:           0xFFFFFFFFFFFFFFFE
456#CHECK:             - Value:           0x1
457#CHECK:             - Value:           0x2
458#CHECK:             - Value:           0x123456789ABCDEF
459