[lld] [lld][Hexagon] Fix R_HEX_B22_PCREL range checks (PR #115925)
Brian Cain via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 12 14:00:14 PST 2024
================
@@ -0,0 +1,45 @@
+# REQUIRES: hexagon
+# RUN: llvm-mc -filetype=obj -triple=hexagon-unknown-elf %s -o %t.o
+
+## Make sure we got the right relocations.
+# RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=REL
+# REL: R_HEX_B9_PCREL 00000000 b9
+# REL: R_HEX_B13_PCREL 00000000 b13
+# REL: R_HEX_B15_PCREL 00000000 b15
+# REL: R_HEX_B22_PCREL 00000000 b22
+
+# RUN: ld.lld %t.o -o %t.out --section-start=.text=0x1000000 \
+# RUN: --section-start=b9=0x1000400 --section-start=b13=0x1004000 \
+# RUN: --section-start=b15=0x1010000 --section-start=b22=0x1800000 \
+# RUN: --threads=1
+# RUN: llvm-objdump -d --no-show-raw-insn %t.out | FileCheck %s
+
+# CHECK-NOT: trampoline
+# CHECK: 01000000 <_start>:
+# CHECK: 1000000: { nop }
+# CHECK: 1000004: { r0 = #0x0 ; jump 0x1000400 }
+# CHECK: 1000008: { if (r0==#0) jump:t 0x1004000 }
+# CHECK: 100000c: { if (p0) jump:nt 0x1010000 }
+# CHECK: 1000010: { jump 0x1800000 }
----------------
androm3da wrote:
Should these / can these be `CHECK-NEXT` instead?
https://github.com/llvm/llvm-project/pull/115925
More information about the llvm-commits
mailing list