[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / ExecutionEngine / JITLink / RISCV / ELF_pc_indirect.s
blob25ae81fcd2f13d0f3007a29b818b95683043575c
1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=riscv64 -position-independent -filetype=obj -o %t/elf_riscv64_sm_pic_reloc.o %s
3 # RUN: llvm-mc -triple=riscv32 -position-independent -filetype=obj -o %t/elf_riscv32_sm_pic_reloc.o %s
4 # RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \
5 # RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \
6 # RUN: -check %s %t/elf_riscv64_sm_pic_reloc.o
7 # RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000\
8 # RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \
9 # RUN: -check %s %t/elf_riscv32_sm_pic_reloc.o
11 # Test ELF small/PIC relocations
13 .text
14 .file "testcase.c"
16 # Empty main entry point.
17 .globl main
18 .p2align 1
19 .type main,@function
20 main:
21 ret
23 .size main, .-main
25 # Test R_RISCV_PCREL_HI20 and R_RISCV_PCREL_LO
26 # jitlink-check: decode_operand(test_pcrel32, 1) = ((external_data - test_pcrel32) + 0x800)[31:12]
27 # jitlink-check: decode_operand(test_pcrel32+4, 2)[11:0] = (external_data - test_pcrel32)[11:0]
28 .globl test_pcrel32
29 .p2align 1
30 .type test_pcrel32,@function
31 test_pcrel32:
32 auipc a0, %pcrel_hi(external_data)
33 lw a0, %pcrel_lo(test_pcrel32)(a0)
35 .size test_pcrel32, .-test_pcrel32
37 # Test R_RISCV_CALL
38 # jitlink-check: decode_operand(test_call, 1) = ((external_func - test_call) + 0x800)[31:12]
39 # jitlink-check: decode_operand(test_call+4, 2)[11:0] = (external_func - test_call)[11:0]
40 .globl test_call
41 .p2align 1
42 .type test_call,@function
43 test_call:
44 call external_func
45 ret
46 .size test_call, .-test_call