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 {
91
91
bool RISCVMCExpr::evaluateAsRelocatableImpl (MCValue &Res,
92
92
const MCAssembler *Asm,
93
93
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))
98
95
return false ;
99
96
100
97
Res =
Original file line number Diff line number Diff line change 1
1
# 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
3
3
4
4
# Check the assembler rejects hi and lo expressions with constant expressions
5
5
# involving labels when diff expressions are emitted as relocation pairs.
6
6
# Test case derived from test/MC/Mips/hilo-addressing.s
7
7
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
+
8
13
tmp1:
9
14
tmp2:
10
15
# CHECK: :[[#@LINE+1]]:[[#]]: error: expected relocatable expression
You can’t perform that action at this time.
0 commit comments