[llvm] [llvm][MC][ARM][Assembly] Emit relocs for LDRs (PR #72873)
David Spickett via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 21 09:14:55 PST 2023
================
@@ -0,0 +1,41 @@
+@ RUN: llvm-mc -filetype=obj -triple=armv7 %s -o %t
+@ RUN: llvm-readelf -r %t | FileCheck %s --check-prefix=ARM
+@ RUN: llvm-objdump -d --triple=armv7 %t | FileCheck %s --check-prefix=ARM_ADDEND
+
+@ ARM: R_ARM_LDRS_PC_G0
+@ ARM: foo1
+@ ARM: R_ARM_LDRS_PC_G0
+@ ARM: foo2
+@ ARM: R_ARM_LDRS_PC_G0
+@ ARM: foo3
+
+// The value format is decimal in these specific cases, but it's hex for other
+// ldr instructions. These checks are valid for both formats.
+
+@ ARM_ADDEND: r0, [pc, #-
+@ ARM_ADDEND 8]
+@ ARM_ADDEND: r0, [pc, #-
+@ ARM_ADDEND 8]
+@ ARM_ADDEND: r0, [pc, #-
+@ ARM_ADDEND 8]
----------------
DavidSpickett wrote:
Generally we'd use a regex here to make the `0x` optional, something like `{{(0x)?}}`, at least that's what's done in other types of test file. That also means you don't get any weird stuff in the middle, `, #-stuffgoeshere8`, not that that's very likely here.
https://github.com/llvm/llvm-project/pull/72873
More information about the llvm-commits
mailing list