forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ORC] Re-add test files that were accidentally left out of e7698a1.
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
llvm/test/ExecutionEngine/JITLink/AArch64/Inputs/MachO_common_x_and_addr_getter.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.section __TEXT,__text,regular,pure_instructions | ||
.globl _getXAddr | ||
.p2align 2 | ||
_getXAddr: | ||
adrp x0, _x@GOTPAGE | ||
ldr x0, [x0, _x@GOTPAGEOFF] | ||
ret | ||
|
||
.comm _x,4,2 | ||
.subsections_via_symbols |
15 changes: 15 additions & 0 deletions
15
llvm/test/ExecutionEngine/JITLink/AArch64/Inputs/MachO_strong_x_and_addr_getter.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.section __TEXT,__text,regular,pure_instructions | ||
.globl _getXAddr | ||
.p2align 2 | ||
_getXAddr: | ||
adrp x0, _x@PAGE | ||
add x0, x0, _x@PAGEOFF | ||
ret | ||
|
||
.section __DATA,__data | ||
.globl _x | ||
.p2align 2, 0x0 | ||
_x: | ||
.long 42 | ||
|
||
.subsections_via_symbols |
33 changes: 33 additions & 0 deletions
33
llvm/test/ExecutionEngine/JITLink/AArch64/MachO_common_symbol_x_multiple_defs.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# RUN: rm -rf %t && mkdir -p %t | ||
# RUN: llvm-mc -triple=arm64-apple-darwin19 -filetype=obj -o %t/main.o %s | ||
# RUN: llvm-mc -triple=arm64-apple-darwin19 -filetype=obj -o %t/aux_common.o \ | ||
# RUN: %S/Inputs/MachO_common_x_and_addr_getter.s | ||
# RUN: llvm-mc -triple=arm64-apple-darwin19 -filetype=obj -o %t/aux_strong.o \ | ||
# RUN: %S/Inputs/MachO_strong_x_and_addr_getter.s | ||
# RUN: llvm-jitlink -noexec %t/main.o %t/aux_common.o | ||
# RUN: llvm-jitlink -noexec -check=%s %t/main.o %t/aux_strong.o | ||
# | ||
# Check that linking multiple common definitions of the same symbol (in this | ||
# case _x) doesn't lead to an "Unexpected definitions" error. | ||
# | ||
# rdar://132314264 | ||
# | ||
# Check that strong defs override: | ||
# jitlink-check: *{8}_x = 42 | ||
|
||
.section __TEXT,__text,regular,pure_instructions | ||
.globl _main | ||
.p2align 2 | ||
_main: | ||
stp x29, x30, [sp, #-16]! | ||
mov x29, sp | ||
bl _getXAddr | ||
adrp x8, _x@GOTPAGE | ||
ldr x8, [x8, _x@GOTPAGEOFF] | ||
cmp x0, x8 | ||
cset w0, eq | ||
ldp x29, x30, [sp], #16 | ||
ret | ||
|
||
.comm _x,4,2 | ||
.subsections_via_symbols |