]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/darwin/native-and-mach-o.objtxt
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / darwin / native-and-mach-o.objtxt
1 # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t  && \
2 # RUN: llvm-nm %t | FileCheck %s
3 #
4 # Test a mix of atoms and mach-o both encoded in yaml
5 #
6
7 --- !native
8 defined-atoms:
9     - name:              _main
10       type:              code
11       scope:             global
12       content:           [ 55, 48, 89, E5, 30, C0, E8, 00,
13                            00, 00, 00, 31, C0, 5D, C3 ]
14       references:
15       - offset:          7
16         kind:            branch32
17         target:          _foo
18
19 undefined-atoms:
20  - name:                _foo
21
22
23 --- !mach-o
24 arch:         x86_64
25 file-type:    MH_OBJECT
26 sections:
27  - segment:     __TEXT
28    section:     __text
29    type:        S_REGULAR
30    attributes:  [ S_ATTR_PURE_INSTRUCTIONS ]
31    address:     0
32    content:     [ 0xC3 ]
33 global-symbols:
34  - name:        _foo
35    type:        N_SECT
36    scope:       [ N_EXT ]
37    sect:        1
38    desc:        [ ]
39    value:       0
40
41 --- !mach-o
42 arch:            x86_64
43 file-type:       MH_DYLIB
44 flags:           [ ]
45 install-name:    /usr/lib/libSystem.B.dylib
46 sections:
47   - segment:         __TEXT
48     section:         __text
49     type:            S_REGULAR
50     attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
51     address:         0x0000000000000000
52     content:         [ 0x55 ]
53
54 global-symbols:
55   - name:            dyld_stub_binder
56     type:            N_SECT
57     scope:           [ N_EXT ]
58     sect:            1
59     value:           0x0000000000000000
60
61
62 ...
63
64 # CHECK:        {{[0-9a-f]+}} T _foo
65 # CHECK:        {{[0-9a-f]+}} T _main