1# RUN: ld64.lld -arch x86_64 -macosx_version_min 10.8 %s \
2# RUN: %p/Inputs/re-exported-dylib-ordinal.yaml \
3# RUN: %p/Inputs/re-exported-dylib-ordinal2.yaml \
4# RUN: %p/Inputs/re-exported-dylib-ordinal3.yaml -dylib -o %t \
5# RUN:  && llvm-nm -m %t | FileCheck %s
6#
7# Test that when one dylib A re-exports dylib B that using a symbol from B
8# gets recorded as coming from A.
9#
10
11--- !mach-o
12arch:            x86_64
13file-type:       MH_OBJECT
14flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
15has-UUID:        false
16OS:              unknown
17sections:
18  - segment:         __TEXT
19    section:         __text
20    type:            S_REGULAR
21    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
22    address:         0x0000000000000000
23    content:         [ 0x55, 0x48, 0x89, 0xE5, 0x31, 0xC0, 0x5D, 0xE9,
24                       0x00, 0x00, 0x00, 0x00 ]
25    relocations:
26      - offset:          0x00000008
27        type:            X86_64_RELOC_BRANCH
28        length:          2
29        pc-rel:          true
30        extern:          true
31        symbol:          1
32global-symbols:
33  - name:            _test
34    type:            N_SECT
35    scope:           [ N_EXT ]
36    sect:            1
37    value:           0x0000000000000000
38undefined-symbols:
39  - name:            _bar
40    type:            N_UNDF
41    scope:           [ N_EXT ]
42    value:           0x0000000000000000
43...
44
45# CHECK:	(undefined) external _bar (from libfoo)
46# CHECK:	(undefined) external dyld_stub_binder (from libSystem)
47