Skip to content

Commit 1e62a35

Browse files
committed
[RISCV] Test %hi(absolute_symbol)
1 parent 41c906f commit 1e62a35

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: llvm/test/MC/RISCV/linker-relaxation.s

+13
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,19 @@ sb t1, %pcrel_lo(2b)(a2)
137137
# RELAX-FIXUP: fixup A - offset: 0, value: %pcrel_lo(.Ltmp1), kind: fixup_riscv_pcrel_lo12_s
138138
# RELAX-FIXUP: fixup B - offset: 0, value: 0, kind: fixup_riscv_relax
139139

140+
lui t2, %hi(abs)
141+
# NORELAX-RELOC-NOT: R_RISCV_
142+
# RELAX-RELOC: R_RISCV_HI20 - 0x12345
143+
# RELAX-RELOC-NEXT: R_RISCV_RELAX - 0x0
144+
# RELAX-FIXUP: fixup A - offset: 0, value: %hi(abs), kind: fixup_riscv_hi20
145+
# RELAX-FIXUP: fixup B - offset: 0, value: 0, kind: fixup_riscv_relax
146+
147+
.set abs, 0x12345
148+
149+
lui t3, %hi(abs)
150+
# RELAX-RELOC-NOT: R_RISCV_
151+
# RELAX-FIXUP-NOT: fixup
152+
140153
# Check that a relocation is not emitted for a symbol difference which has
141154
# been folded to a fixup with an absolute value. This can happen when a
142155
# difference expression refers to two symbols, at least one of which is

0 commit comments

Comments
 (0)