[PATCH] D60657: [RISCV] Fix evaluation of %pcrel_lo

James Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 08:01:03 PDT 2019


jrtc27 added inline comments.


================
Comment at: llvm/test/MC/RISCV/pcrel-fixups.s:2
+# RUN: llvm-mc -triple riscv32 -mattr=-relax -filetype obj %s \
+# RUN:    | llvm-objdump  -d -r - | FileCheck --check-prefix NORELAX %s
+# RUN: llvm-mc -triple riscv32 -mattr=+relax -filetype obj %s \
----------------
`fixups.s` uses `-riscv-no-aliases` so you can check the `mv` is really an `addi` with 0 immediate.


================
Comment at: llvm/test/MC/RISCV/pcrel-fixups.s:17
+	addi	a1, a0, %pcrel_lo(.Lpcrel_label1)
+# NORELAX: auipc	a0, 0
+# NORELAX: addi	a1, a0, 16
----------------
It's probably a good idea to put a `# NORELAX-NOT: R_RISCV` after each of these instructions (especially since the `auipc` with 0 immediate is also what you get if there's a relocation for the line).


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60657/new/

https://reviews.llvm.org/D60657





More information about the llvm-commits mailing list