File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
lib/Target/RISCV/MCTargetDesc Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -91,10 +91,7 @@ const MCFixup *RISCVMCExpr::getPCRelHiFixup(const MCFragment **DFOut) const {
9191bool RISCVMCExpr::evaluateAsRelocatableImpl (MCValue &Res,
9292 const MCAssembler *Asm,
9393 const MCFixup *Fixup) const {
94- // Explicitly drop the layout and assembler to prevent any symbolic folding in
95- // the expression handling. This is required to preserve symbolic difference
96- // expressions to emit the paired relocations.
97- if (!getSubExpr ()->evaluateAsRelocatable (Res, nullptr , nullptr ))
94+ if (!getSubExpr ()->evaluateAsRelocatable (Res, Asm, Fixup))
9895 return false ;
9996
10097 Res =
Original file line number Diff line number Diff line change 11# RUN: not llvm-mc -filetype=obj -triple=riscv32 -mattr=+relax %s -o /dev/null 2>&1 | FileCheck %s
2- # RUN: not llvm-mc -filetype=obj -triple=riscv32 -mattr=-relax %s -o /dev/null 2>&1 | FileCheck %s
2+ # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=-relax %s | llvm-objdump -d - | FileCheck %s --check-prefix=NORELAX
33
44# Check the assembler rejects hi and lo expressions with constant expressions
55# involving labels when diff expressions are emitted as relocation pairs.
66# Test case derived from test/MC/Mips/hilo-addressing.s
77
8+ # NORELAX: lui t0, 0x0
9+ # NORELAX-NEXT: lw ra, 0x8(t0)
10+ # NORELAX: lui t1, 0x0
11+ # NORELAX-NEXT: lw sp, -0x8(t1)
12+
813tmp1:
914tmp2:
1015# CHECK: :[[#@LINE+1]]:[[#]]: error: expected relocatable expression
You can’t perform that action at this time.
0 commit comments