1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=riscv64 -filetype=obj -o %t/elf_riscv64_non_pc_indirect_reloc.o %s
3 # RUN: llvm-mc -triple=riscv32 -filetype=obj -o %t/elf_riscv32_non_pc_indirect_reloc.o %s
4 # RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 -define-abs external_data=0xfff10000\
5 # RUN: -check %s %t/elf_riscv64_non_pc_indirect_reloc.o
6 # RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 -define-abs external_data=0xfff10000\
7 # RUN: -check %s %t/elf_riscv32_non_pc_indirect_reloc.o
13 # Empty main entry point.
22 # Test R_RISCV_HI20 and R_RISCV_LO12
24 # jitlink-check: decode_operand(test_abs_rel, 1) = (external_data + 0x800)[31:12]
25 # jitlink-check: decode_operand(test_abs_rel+4, 2)[11:0] = (external_data)[11:0]
28 .type test_abs_rel,@function
30 lui a0
, %hi
(external_data
)
31 lw a0
, %lo
(external_data
)(a0
)
33 .size test_abs_rel, .-test_abs_rel