1# RUN: ld64.lld.darwinold -arch x86_64 %s \
2# RUN: %p/Inputs/use-simple-dylib.yaml %p/Inputs/x86_64/libSystem.yaml -dylib -o %t.dylib
3# RUN: llvm-objdump --private-headers %t.dylib | FileCheck %s
4
5# This test ensures that we have a LC_LOAD_DYLIB for libspecial.dylib even though we don't
6# use any atoms from it.  This matches the ld64 behaviour.
7--- !mach-o
8arch:            x86_64
9file-type:       MH_OBJECT
10flags:           [  ]
11has-UUID:        false
12OS:              unknown
13sections:
14  - segment:         __TEXT
15    section:         __text
16    type:            S_REGULAR
17    attributes:      [ S_ATTR_PURE_INSTRUCTIONS ]
18    address:         0x0000000000000000
19    content:         [ 0x55, 0x48, 0x89, 0xE5, 0xE8, 0x00, 0x00, 0x00,
20                       0x00, 0xE8, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x00,
21                       0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x00,
22                       0xE8, 0x00, 0x00, 0x00, 0x00, 0x5D, 0xE9, 0x00,
23                       0x00, 0x00, 0x00 ]
24global-symbols:
25  - name:            _foo
26    type:            N_SECT
27    scope:           [ N_EXT ]
28    sect:            1
29    value:           0x0000000000000000
30
31
32# CHECK:           cmd LC_LOAD_DYLIB
33# CHECK:          name libspecial.dylib (offset 24)
34# CHECK:       current version 1.0.0
35# CHECK: compatibility version 1.0.0
36# CHECK:           cmd LC_LOAD_DYLIB
37# CHECK:          name /usr/lib/libSystem.B.dylib (offset 24)
38# CHECK:       current version 1.0.0
39# CHECK: compatibility version 1.0.0
40