[Instrumentation] Fix a warning
[llvm-project.git] / llvm / test / ExecutionEngine / JITLink / AArch64 / MachO_common_symbol_x_multiple_defs.s
blob5a8a916d30afe7d8bac3e21a08a32ad6c0354ee3
1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=arm64-apple-darwin19 -filetype=obj -o %t/main.o %s
3 # RUN: llvm-mc -triple=arm64-apple-darwin19 -filetype=obj -o %t/aux_common.o \
4 # RUN: %S/Inputs/MachO_common_x_and_addr_getter.s
5 # RUN: llvm-mc -triple=arm64-apple-darwin19 -filetype=obj -o %t/aux_strong.o \
6 # RUN: %S/Inputs/MachO_strong_x_and_addr_getter.s
7 # RUN: llvm-jitlink -noexec %t/main.o %t/aux_common.o
8 # RUN: llvm-jitlink -noexec -check=%s %t/main.o %t/aux_strong.o
10 # Check that linking multiple common definitions of the same symbol (in this
11 # case _x) doesn't lead to an "Unexpected definitions" error.
13 # rdar://132314264
15 # Check that strong defs override:
16 # jitlink-check: *{8}_x = 42
18 .section __TEXT,__text,regular,pure_instructions
19 .globl _main
20 .p2align 2
21 _main:
22 stp x29, x30, [sp, #-16]!
23 mov x29, sp
24 bl _getXAddr
25 adrp x8, _x@GOTPAGE
26 ldr x8, [x8, _x@GOTPAGEOFF]
27 cmp x0, x8
28 cset w0, eq
29 ldp x29, x30, [sp], #16
30 ret
32 .comm _x,4,2
33 .subsections_via_symbols