1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj \
3 # RUN: -o %t/file_to_test.o %S/Inputs/MachO_test_harness_test.s
4 # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj \
5 # RUN: -o %t/test_harness.o %s
6 # RUN: not llvm-jitlink -noexec -check %s %t/file_to_test.o \
7 # RUN: -harness %t/test_harness.o
8 # RUN: llvm-jitlink -noexec -phony-externals -check %s %t/file_to_test.o \
9 # RUN: -harness %t/test_harness.o
12 # (1) Can call global symbols in the test object.
13 # (2) Can call private symbols in the test object.
14 # (3) Can interpose global symbols in the test object.
15 # (4) Can interpose private symbols in the test object.
16 # (5) Don't need to resolve unused externals in the test object.
18 .section __TEXT,__text,regular,pure_instructions
20 .globl _public_func_to_interpose
22 _public_func_to_interpose
:
25 .globl _private_func_to_interpose
27 _private_func_to_interpose
:
33 callq _public_func_to_test
34 callq _private_func_to_test
38 .section __DATA,__data
40 # Check that the harness and test file agree on the address of the addresses
43 # jitlink-check: *{8}_public_func_to_interpose_as_seen_by_harness = \
44 # jitlink-check: *{8}_public_func_to_interpose_as_seen_by_test
46 # jitlink-check: *{8}_private_func_to_interpose_as_seen_by_harness = \
47 # jitlink-check: *{8}_private_func_to_interpose_as_seen_by_test
49 .globl _public_func_to_interpose_as_seen_by_harness
51 _public_func_to_interpose_as_seen_by_harness
:
52 .quad _public_func_to_interpose
54 .globl _private_func_to_interpose_as_seen_by_harness
56 _private_func_to_interpose_as_seen_by_harness
:
57 .quad _private_func_to_interpose
59 # We need to reference the *_as_seen_by_test pointers used above to ensure
60 # that they're not dead-stripped as unused.
61 .globl _anchor_test_case_pointers
63 _anchor_test_case_pointers
:
64 .quad _public_func_to_interpose_as_seen_by_test
65 .quad _private_func_to_interpose_as_seen_by_test
67 .subsections_via_symbols