1# RUN: ld64.lld.darwinold -arch x86_64 %p/Inputs/libfoo.a %s -o %t \
2# RUN:    %p/Inputs/x86_64/libSystem.yaml
3# RUN: llvm-nm -m -n %t | FileCheck %s
4#
5# Test that if library is before object file on command line, it still is used.
6#
7
8--- !mach-o
9arch:            x86_64
10file-type:       MH_OBJECT
11flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
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, 0x48, 0x89, 0xE5, 0x48, 0x83, 0xEC, 0x10,
20                       0xC7, 0x45, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xB0,
21                       0x00, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x31, 0xC0,
22                       0x48, 0x83, 0xC4, 0x10, 0x5D, 0xC3 ]
23    relocations:
24      - offset:          0x00000012
25        type:            X86_64_RELOC_BRANCH
26        length:          2
27        pc-rel:          true
28        extern:          true
29        symbol:          1
30global-symbols:
31  - name:            _main
32    type:            N_SECT
33    scope:           [ N_EXT ]
34    sect:            1
35    value:           0x0000000000000000
36undefined-symbols:
37  - name:            _foo
38    type:            N_UNDF
39    scope:           [ N_EXT ]
40    value:           0x0000000000000000
41
42...
43
44# CHECK:	{{[0-9a-f]+}} (__TEXT,__text) external _main
45# CHECK:	{{[0-9a-f]+}} (__TEXT,__text) external _foo
46