[llvm] [llvm][MC][ARM][Assembly] Emit relocs for LDRs (PR #72873)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 01:31:16 PST 2023


================
@@ -0,0 +1,45 @@
+@ 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
+@ RUN: llvm-mc -filetype=obj -triple=thumbv7 %s -o %t
+@ RUN: llvm-readelf -r %t | FileCheck %s --check-prefix=THUMB
+@ RUN: llvm-objdump -d --triple=thumbv7 %t | FileCheck %s --check-prefix=THUMB_ADDEND
+
+@ ARM: R_ARM_LDR_PC_G0
+@ ARM: foo1
----------------
DavidSpickett wrote:

What's the text you're checking for here? Again, just being paranoid that:
```
R_ARM_LDR_PC_G0
random_symbol
R_SOMETHING_ELSE
foo1
```

Would match this too.

If they are on the next line you can do ARM-NEXT: and lit will make sure there's no extra stuff there, or regex is an option if you've got stuff in between that varies e.g. offsets and the like.

https://github.com/llvm/llvm-project/pull/72873


More information about the llvm-commits mailing list