Skip to content

Commit 63e1799

Browse files
committed
[ORC] Re-add test files that were accidentally left out of e7698a1.
1 parent e7698a1 commit 63e1799

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.section __TEXT,__text,regular,pure_instructions
2+
.globl _getXAddr
3+
.p2align 2
4+
_getXAddr:
5+
adrp x0, _x@GOTPAGE
6+
ldr x0, [x0, _x@GOTPAGEOFF]
7+
ret
8+
9+
.comm _x,4,2
10+
.subsections_via_symbols
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.section __TEXT,__text,regular,pure_instructions
2+
.globl _getXAddr
3+
.p2align 2
4+
_getXAddr:
5+
adrp x0, _x@PAGE
6+
add x0, x0, _x@PAGEOFF
7+
ret
8+
9+
.section __DATA,__data
10+
.globl _x
11+
.p2align 2, 0x0
12+
_x:
13+
.long 42
14+
15+
.subsections_via_symbols
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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
9+
#
10+
# Check that linking multiple common definitions of the same symbol (in this
11+
# case _x) doesn't lead to an "Unexpected definitions" error.
12+
#
13+
# rdar://132314264
14+
#
15+
# Check that strong defs override:
16+
# jitlink-check: *{8}_x = 42
17+
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
31+
32+
.comm _x,4,2
33+
.subsections_via_symbols

0 commit comments

Comments
 (0)