21 lines · plain
1# RUN: llvm-mc -triple riscv32 -mattr=+c -M no-aliases %s -show-encoding \2# RUN: | FileCheck -check-prefix=INSTR %s3# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+c < %s \4# RUN: | llvm-readobj -r - | FileCheck -check-prefix=RELOC %s5# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+c,+relax < %s \6# RUN: | llvm-readobj -r - | FileCheck -check-prefix=RELOC %s7 8# Check prefixes:9# RELOC - Check the relocation in the object.10# INSTR - Check the instruction is handled properly by the ASMPrinter11c.jal foo12# A compressed jump (c.j) to an unresolved symbol will be relaxed to a (jal).13# RELOC: R_RISCV_JAL14# INSTR: c.jal foo15 16c.bnez a0, foo17# A compressed branch (c.bnez) to an unresolved symbol will be relaxed to a (bnez).18# The (bnez) to an unresolved symbol will in turn be relaxed to (beqz; jal)19# RELOC-NEXT: R_RISCV_JAL20# INSTR: c.bnez a0, foo21