llvm-for-llvmta/test/MC/RISCV/hilo-constaddr.s

18 lines
604 B
ArmAsm
Raw Permalink Normal View History

2022-04-25 10:02:23 +02:00
# RUN: llvm-mc -filetype=obj -triple=riscv32 %s \
# RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INSTR
# RUN: llvm-mc -filetype=obj -triple=riscv32 %s \
# RUN: | llvm-readobj -r - | FileCheck %s -check-prefix=CHECK-REL
# Check the assembler can handle hi and lo expressions with a constant
# address. Test case derived from test/MC/Mips/hilo-addressing.s
# Check that 1 is added to the high 20 bits if bit 11 of the low part is 1.
.equ addr, 0xdeadbeef
lui t0, %hi(addr)
lw ra, %lo(addr)(t0)
# CHECK-INSTR: lui t0, 912092
# CHECK-INSTR: lw ra, -273(t0)
# CHECK-REL-NOT: R_RISCV