1# RUN: ld64.lld.darwinold -arch i386 -r -print_atoms %s -o %t  | FileCheck %s
2#
3# Test parsing of __LD/__compact_unwind (compact unwind) section.
4#
5
6--- !mach-o
7arch:            x86
8file-type:       MH_OBJECT
9flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
10has-UUID:        false
11OS:              unknown
12sections:
13  - segment:         __TEXT
14    section:         __text
15    type:            S_REGULAR
16    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
17    alignment:       4
18    address:         0x0000000000000000
19    content:         [ 0x55, 0x89, 0xE5, 0xB8, 0x0A, 0x00, 0x00, 0x00,
20                       0x5D, 0xC3, 0x55, 0x89, 0xE5, 0xB8, 0x0A, 0x00,
21                       0x00, 0x00, 0x5D, 0xC3 ]
22  - segment:         __LD
23    section:         __compact_unwind
24    type:            S_REGULAR
25    attributes:      [  ]
26    alignment:       2
27    address:         0x000000000000001C
28    content:         [ 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00,
29                       0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
30                       0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
31                       0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
32                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
33    relocations:
34      - offset:          0x00000014
35        type:            GENERIC_RELOC_VANILLA
36        length:          2
37        pc-rel:          false
38        extern:          false
39        symbol:          1
40      - offset:          0x00000000
41        type:            GENERIC_RELOC_VANILLA
42        length:          2
43        pc-rel:          false
44        extern:          false
45        symbol:          1
46global-symbols:
47  - name:            __Z3barv
48    type:            N_SECT
49    scope:           [ N_EXT ]
50    sect:            1
51    value:           0x000000000000000A
52  - name:            __Z3foov
53    type:            N_SECT
54    scope:           [ N_EXT ]
55    sect:            1
56    value:           0x0000000000000000
57...
58
59# CHECK: defined-atoms:
60# CHECK:   - type:            compact-unwind
61# CHECK:     content:         [ 00, 00, 00, 00, 0A, 00, 00, 00, 00, 00, 00, 01,
62# CHECK:                        00, 00, 00, 00, 00, 00, 00, 00 ]
63# CHECK:   - type:            compact-unwind
64# CHECK:     content:         [ 10, 00, 00, 00, 0A, 00, 00, 00, 00, 00, 00, 01,
65# CHECK:                        00, 00, 00, 00, 00, 00, 00, 00 ]
66# CHECK:   - name:            __Z3foov
67# CHECK:     scope:           global
68# CHECK:     content:         [ 55, 89, E5, B8, 0A, 00, 00, 00, 5D, C3 ]
69# CHECK:   - name:            __Z3barv
70# CHECK:     scope:           global
71# CHECK:     content:         [ 55, 89, E5, B8, 0A, 00, 00, 00, 5D, C3 ]
72
73