1# RUN: ld64.lld.darwinold -arch x86_64 -r -print_atoms %s -o %t  | FileCheck %s
2#
3# Test parsing of mach-o data symbols.
4#
5# long a = 0x0807060504030201;
6# int b = 0x14131211;
7# int c = 0x24232221;
8# static int s1;
9# static int s2 = 0x34333231;
10#
11#
12
13
14--- !mach-o
15arch:            x86_64
16file-type:       MH_OBJECT
17flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
18has-UUID:        false
19OS:              unknown
20sections:
21  - segment:         __DATA
22    section:         __data
23    type:            S_REGULAR
24    attributes:      [  ]
25    alignment:       8
26    address:         0x0000000000000000
27    content:         [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
28                       0x11, 0x12, 0x13, 0x14, 0x21, 0x22, 0x23, 0x24,
29                       0x31, 0x32, 0x33, 0x34, 0x41, 0x42, 0x43, 0x44 ]
30  - segment:         __CUST
31    section:         __custom
32    type:            S_REGULAR
33    attributes:      [  ]
34    alignment:       8
35    address:         0x0000000000000018
36    content:         [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 ]
37  - segment:         __DATA
38    section:         __bss
39    type:            S_ZEROFILL
40    attributes:      [  ]
41    alignment:       2
42    address:         0x0000000000000020
43    size:            4
44local-symbols:
45  - name:            _s1
46    type:            N_SECT
47    sect:            3
48    value:           0x0000000000000020
49  - name:            _s2
50    type:            N_SECT
51    sect:            1
52    value:           0x0000000000000010
53global-symbols:
54  - name:            _a
55    type:            N_SECT
56    scope:           [ N_EXT ]
57    sect:            1
58    value:           0x0000000000000000
59  - name:            _b
60    type:            N_SECT
61    scope:           [ N_EXT ]
62    sect:            1
63    value:           0x0000000000000008
64  - name:            _c
65    type:            N_SECT
66    scope:           [ N_EXT ]
67    sect:            1
68    value:           0x000000000000000C
69  - name:            _cWeak
70    type:            N_SECT
71    scope:           [ N_EXT ]
72    sect:            1
73    desc:            [ N_WEAK_DEF ]
74    value:           0x0000000000000014
75  - name:            _kustom
76    type:            N_SECT
77    scope:           [ N_EXT ]
78    sect:            2
79    value:           0x0000000000000018
80...
81
82# CHECK: defined-atoms:
83
84# CHECK:   - name:            _a
85# CHECK:     scope:           global
86# CHECK:     type:            data
87# CHECK:     content:         [ 01, 02, 03, 04, 05, 06, 07, 08 ]
88
89# CHECK:   - name:            _b
90# CHECK:     scope:           global
91# CHECK:     type:            data
92# CHECK:     content:         [ 11, 12, 13, 14 ]
93
94# CHECK:   - name:            _c
95# CHECK:     scope:           global
96# CHECK:     type:            data
97# CHECK:     content:         [ 21, 22, 23, 24 ]
98
99# CHECK:   - name:            _s2
100# CHECK:     type:            data
101# CHECK:     content:         [ 31, 32, 33, 34 ]
102
103# CHECK:   - name:            _cWeak
104# CHECK:     scope:           global
105# CHECK:     type:            data
106# CHECK:     content:         [ 41, 42, 43, 44 ]
107# CHECK:     merge:           as-weak
108
109# CHECK:   - name:            _s1
110# CHECK:     type:            zero-fill
111# CHECK:     size:            4
112
113# CHECK:   - name:            _kustom
114# CHECK:     scope:           global
115# CHECK:     type:            unknown
116# CHECK:     content:         [ 01, 02, 03, 04, 05, 06, 07, 08 ]
117# CHECK:     section-choice:  custom-required
118# CHECK:     section-name:    '__CUST/__custom'
119
120