50 lines · plain
1# RUN: rm -rf %t && mkdir -p %t2# RUN: llvm-mc -triple=riscv64 -mattr=+c,+relax -filetype=obj \3# RUN: -o %t/elf_riscv64_rvc.o %s4# RUN: llvm-mc -triple=riscv32 -mattr=+c,+relax -filetype=obj \5# RUN: -o %t/elf_riscv32_rvc.o %s6# RUN: llvm-jitlink -noexec \7# RUN: -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 \8# RUN: -check %s %t/elf_riscv64_rvc.o9# RUN: llvm-jitlink -noexec \10# RUN: -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 \11# RUN: -check %s %t/elf_riscv32_rvc.o12 13.globl main14main:15 ret16 17# Test R_RISCV_RVC_BRANCH18 19# jitlink-check: *{2}(test_rvc_branch) = 0xC11120# jitlink-check: *{2}(test_rvc_branch+2) = 0xE10921.globl test_rvc_branch22.type test_rvc_branch,@function23test_rvc_branch:24 c.beqz a0, test_rvc_branch_ret25 c.bnez a0, test_rvc_branch_ret26test_rvc_branch_ret:27 ret28# jitlink-check: *{2}(test_rvc_branch+6) = 0xDD7D29# jitlink-check: *{2}(test_rvc_branch+8) = 0xFD7530test_rvc_branch2:31 c.beqz a0, test_rvc_branch_ret32 c.bnez a0, test_rvc_branch_ret33 34.size test_rvc_branch, .-test_rvc_branch35 36# Test R_RISCV_RVC_JUMP37 38# jitlink-check: *{2}(test_rvc_jump) = 0xA00939.globl test_rvc_jump40.type test_rvc_jump,@function41test_rvc_jump:42 c.j test_rvc_jump_ret43test_rvc_jump_ret:44 ret45# jitlink-check: *{2}(test_rvc_jump+4) = 0xBFFD46test_rvc_jump2:47 c.j test_rvc_jump_ret48 49.size test_rvc_jump, .-test_rvc_jump50