[llvm] [LoongArch] Emit R_LARCH_RELAX when expanding some LoadAddress (PR #72961)
Lu Weining via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 19 03:49:23 PST 2023
================
@@ -1,66 +1,110 @@
# RUN: llvm-mc --triple=loongarch64 %s | FileCheck %s
+# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=-relax %s -o %t
+# RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=RELOC
+# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=+relax %s -o %t.relax
+# RUN: llvm-readobj -r %t.relax | FileCheck %s --check-prefixes=RELOC,RELAX
la.abs $a0, sym_abs
# CHECK: lu12i.w $a0, %abs_hi20(sym_abs)
# CHECK-NEXT: ori $a0, $a0, %abs_lo12(sym_abs)
# CHECK-NEXT: lu32i.d $a0, %abs64_lo20(sym_abs)
# CHECK-NEXT: lu52i.d $a0, $a0, %abs64_hi12(sym_abs)
+# RELOC: R_LARCH_ABS_HI20 sym_abs 0x0
+# RELOC-NEXT: R_LARCH_ABS_LO12 sym_abs 0x0
+# RELOC-NEXT: R_LARCH_ABS64_LO20 sym_abs 0x0
+# RELOC-NEXT: R_LARCH_ABS64_HI12 sym_abs 0x0
la.pcrel $a0, sym_pcrel
# CHECK: pcalau12i $a0, %pc_hi20(sym_pcrel)
# CHECK-NEXT: addi.d $a0, $a0, %pc_lo12(sym_pcrel)
+# RELOC: R_LARCH_PCALA_HI20 sym_pcrel 0x0
----------------
SixWeining wrote:
Had better to use `RELOC-NEXT` for more accurate.
Seems we also should change `CHECK` to `CHECK-NEXT` before this PR.
https://github.com/llvm/llvm-project/pull/72961
More information about the llvm-commits
mailing list