[lld] [LLD][RISCV] Fix incorrect call relaxation when mixing +c and -c objects (PR #73977)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 21:24:44 PST 2023


================
@@ -0,0 +1,30 @@
+# REQUIRES: riscv
+# RUN: rm -rf %t && split-file %s %t && cd %t
+# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c,+relax a.s -o a.o
+# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=-c,+relax b.s -o b.o
+
+# RUN: ld.lld a.o b.o --shared -o a
+# RUN: llvm-objdump -d --no-show-raw-insn -M no-aliases a | FileCheck %s
+
+## This needs to be a *uncompressed* jal instruction since it came from the
+## source file which does not enable C
+# CHECK-LABEL: <foo>:
+# CHECK-NEXT:    1260: jal zero, 0x1260 <foo>
+# CHECK-NEXT:    1264: addi zero, zero, 0
+
+# w/C
----------------
MaskRay wrote:

Missing space? `w/ C`

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


More information about the llvm-commits mailing list