diff options
author | Fangrui Song <i@maskray.me> | 2025-03-28 23:54:01 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2025-03-28 23:54:01 -0700 |
commit | 1e62a3505fa0d0ef1f706549ce62f645f3091cfa (patch) | |
tree | c1c28636b3808ff29ebf0d917fa180cececc4fd5 | |
parent | 41c906fe2b62a8266874a1146b9c85d96f1fa8fa (diff) | |
download | llvm-1e62a3505fa0d0ef1f706549ce62f645f3091cfa.zip llvm-1e62a3505fa0d0ef1f706549ce62f645f3091cfa.tar.gz llvm-1e62a3505fa0d0ef1f706549ce62f645f3091cfa.tar.bz2 |
[RISCV] Test %hi(absolute_symbol)
-rw-r--r-- | llvm/test/MC/RISCV/linker-relaxation.s | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/MC/RISCV/linker-relaxation.s b/llvm/test/MC/RISCV/linker-relaxation.s index ca1796f..f9bffb6 100644 --- a/llvm/test/MC/RISCV/linker-relaxation.s +++ b/llvm/test/MC/RISCV/linker-relaxation.s @@ -137,6 +137,19 @@ sb t1, %pcrel_lo(2b)(a2) # RELAX-FIXUP: fixup A - offset: 0, value: %pcrel_lo(.Ltmp1), kind: fixup_riscv_pcrel_lo12_s # RELAX-FIXUP: fixup B - offset: 0, value: 0, kind: fixup_riscv_relax +lui t2, %hi(abs) +# NORELAX-RELOC-NOT: R_RISCV_ +# RELAX-RELOC: R_RISCV_HI20 - 0x12345 +# RELAX-RELOC-NEXT: R_RISCV_RELAX - 0x0 +# RELAX-FIXUP: fixup A - offset: 0, value: %hi(abs), kind: fixup_riscv_hi20 +# RELAX-FIXUP: fixup B - offset: 0, value: 0, kind: fixup_riscv_relax + +.set abs, 0x12345 + +lui t3, %hi(abs) +# RELAX-RELOC-NOT: R_RISCV_ +# RELAX-FIXUP-NOT: fixup + # Check that a relocation is not emitted for a symbol difference which has # been folded to a fixup with an absolute value. This can happen when a # difference expression refers to two symbols, at least one of which is |