[PATCH] D126284: [JITLink][ELF/AARCH64][NFC] Add ADRP and ADD (imm) relocation test case
Sunho Kim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 24 03:27:01 PDT 2022
sunho created this revision.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
sunho requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch adds relocation test cases for R_AARCH64_ADR_PREL_PG_HI21 and R_AARCH64_ADD_ABS_LO12_NC.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D126284
Files:
llvm/test/ExecutionEngine/JITLink/AArch64/ELF_aarch64_adrp.s
Index: llvm/test/ExecutionEngine/JITLink/AArch64/ELF_aarch64_adrp.s
===================================================================
--- /dev/null
+++ llvm/test/ExecutionEngine/JITLink/AArch64/ELF_aarch64_adrp.s
@@ -0,0 +1,27 @@
+# RUN: rm -rf %t && mkdir -p %t
+# RUN: llvm-mc -triple=aarch64-unknown-linux-gnu -relax-relocations=false -position-independent -filetype=obj -o %t/elf_aarch64_adrp.o %s
+# RUN: llvm-jitlink -noexec -check %s %t/elf_aarch64_adrp.o
+
+ .text
+
+# Test Case 1: R_AARCH64_ADR_PREL_PG_HI21
+# jitlink-check: decode_operand(main, 1) = (((str + 0) & 0xFFFFFFFFFFFFF000) - (main & 0xFFFFFFFFFFFFF000))[32:12]
+#
+# Test Case 2: R_AARCH64_ADD_ABS_LO12_NC
+# jitlink-check: decode_operand(main + 4, 2) = (str + 0)[11:0]
+
+
+ .globl main
+ .p2align 2
+ .type main, at function
+main:
+ adrp x0, str
+ add x0, x0, :lo12:str
+ ret
+ .size main, .-main
+
+ .globl str
+ .type str, at object
+str:
+ .asciz "hello world"
+ .size str, 12
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126284.431629.patch
Type: text/x-patch
Size: 984 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220524/d46eadd8/attachment.bin>
More information about the llvm-commits
mailing list