1# RUN: ld64.lld.darwinold -arch x86_64 -r  %s -o %t -print_atoms | FileCheck %s
2#
3# Test -keep_private_externs in -r mode.
4#
5
6--- !mach-o
7arch:            x86_64
8file-type:       MH_OBJECT
9flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
10sections:
11  - segment:         __TEXT
12    section:         __objc_methname
13    type:            S_CSTRING_LITERALS
14    attributes:      [  ]
15    address:         0x0000000000000000
16    content:         [ 0x61, 0x62, 0x63, 0x00, 0x64, 0x65, 0x66, 0x00 ]
17  - segment:         __TEXT
18    section:         __objc_classname
19    type:            S_CSTRING_LITERALS
20    attributes:      [  ]
21    address:         0x0000000000000006
22    content:         [ 0x61, 0x62, 0x63, 0x00, 0x67, 0x68, 0x69, 0x00 ]
23  - segment:         __TEXT
24    section:         __cstring
25    type:            S_CSTRING_LITERALS
26    attributes:      [  ]
27    address:         0x000000000000000A
28    content:         [ 0x61, 0x62, 0x63, 0x00, 0x6A, 0x6B, 0x6C, 0x00 ]
29
30
31...
32
33# CHECK: defined-atoms:
34# CHECK:   - scope:           hidden
35# CHECK:     type:            c-string
36# CHECK:     content:         [ 61, 62, 63, 00 ]
37# CHECK:     merge:           by-content
38# CHECK:     section-choice:  custom-required
39# CHECK:     section-name:    '__TEXT/__objc_methname'
40# CHECK:   - scope:           hidden
41# CHECK:     type:            c-string
42# CHECK:     content:         [ 64, 65, 66, 00 ]
43# CHECK:     merge:           by-content
44# CHECK:     section-choice:  custom-required
45# CHECK:     section-name:    '__TEXT/__objc_methname'
46# CHECK:   - scope:           hidden
47# CHECK:     type:            c-string
48# CHECK:     content:         [ 61, 62, 63, 00 ]
49# CHECK:     merge:           by-content
50# CHECK:     section-choice:  custom-required
51# CHECK:     section-name:    '__TEXT/__objc_classname'
52# CHECK:   - scope:           hidden
53# CHECK:     type:            c-string
54# CHECK:     content:         [ 67, 68, 69, 00 ]
55# CHECK:     merge:           by-content
56# CHECK:     section-choice:  custom-required
57# CHECK:     section-name:    '__TEXT/__objc_classname'
58# CHECK:   - scope:           hidden
59# CHECK:     type:            c-string
60# CHECK:     content:         [ 61, 62, 63, 00 ]
61# CHECK:     merge:           by-content
62# CHECK:   - scope:           hidden
63# CHECK:     type:            c-string
64# CHECK:     content:         [ 6A, 6B, 6C, 00 ]
65# CHECK:     merge:           by-content
66