Index: test/MC/RISCV/cnop.s =================================================================== --- test/MC/RISCV/cnop.s +++ test/MC/RISCV/cnop.s @@ -10,8 +10,9 @@ .type alpha,@function alpha: # BB#0: - addi sp, sp, -16 + c.addi sp, -16 c.lw a0, 0(a0) + c.lw a1, 4(a0) # CHECK-INST: c.nop .Lfunc_end0: .size alpha, .Lfunc_end0-alpha Index: test/MC/RISCV/compress-relocations.s =================================================================== --- /dev/null +++ test/MC/RISCV/compress-relocations.s @@ -0,0 +1,13 @@ +# RUN: llvm-mc -triple riscv32 -mattr=+c -riscv-no-aliases < %s -show-encoding \ +# RUN: | FileCheck -check-prefix=INSTR -check-prefix=FIXUP %s + +# Check prefixes: +# FIXUP - Check the fixup on the instruction. +# INSTR - Check the instruction is handled properly by the ASMPrinter +c.jal foo +# INSTR: c.jal foo +# FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_rvc_jump + +c.bnez a0, foo +# INSTR: c.bnez a0, foo +# FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_rvc_branch Index: test/MC/RISCV/fixups-compressed.s =================================================================== --- test/MC/RISCV/fixups-compressed.s +++ test/MC/RISCV/fixups-compressed.s @@ -1,14 +1,14 @@ # RUN: llvm-mc %s -triple riscv32 -mattr=+c -show-encoding \ # RUN: | FileCheck -check-prefix=CHECK-FIXUP %s # RUN: llvm-mc -triple riscv32 -filetype=obj -mattr=+c < %s \ -# RUN: | llvm-objdump -d - | FileCheck -check-prefix=CHECK-INSTR %s +# RUN: | llvm-objdump -riscv-no-aliases -d - | FileCheck -check-prefix=CHECK-INSTR %s .LBB0_2: # CHECK-FIXUP: fixup A - offset: 0, value: .LBB0_2, kind: fixup_riscv_rvc_jump # CHECK-INSTR: c.j 0 c.j .LBB0_2 # CHECK: fixup A - offset: 0, value: func1, kind: fixup_riscv_rvc_jump -# CHECK-INSTR: c.jal 0 +# CHECK-INSTR: c.jal 6 c.jal func1 # CHECK-FIXUP: fixup A - offset: 0, value: .LBB0_2, kind: fixup_riscv_rvc_branch # CHECK-INSTR: c.beqz a3, -4 @@ -16,3 +16,5 @@ # CHECK-FIXUP: fixup A - offset: 0, value: .LBB0_2, kind: fixup_riscv_rvc_branch # CHECK-INSTR: c.bnez a5, -6 c.bnez a5, .LBB0_2 + +func1: Index: test/MC/RISCV/relocations.s =================================================================== --- test/MC/RISCV/relocations.s +++ test/MC/RISCV/relocations.s @@ -1,6 +1,6 @@ -# RUN: llvm-mc -triple riscv32 -mattr=+c -riscv-no-aliases < %s -show-encoding \ +# RUN: llvm-mc -triple riscv32 -riscv-no-aliases < %s -show-encoding \ # RUN: | FileCheck -check-prefix=INSTR -check-prefix=FIXUP %s -# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+c < %s \ +# RUN: llvm-mc -filetype=obj -triple riscv32 < %s \ # RUN: | llvm-readobj -r | FileCheck -check-prefix=RELOC %s # Check prefixes: @@ -83,13 +83,3 @@ # RELOC: R_RISCV_BRANCH # INSTR: bgeu a0, a1, foo # FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_branch - -c.jal foo -# RELOC: R_RISCV_RVC_JUMP -# INSTR: c.jal foo -# FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_rvc_jump - -c.bnez a0, foo -# RELOC: R_RISCV_RVC_BRANCH -# INSTR: c.bnez a0, foo -# FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_rvc_branch Index: test/MC/RISCV/rv32c-only-valid.s =================================================================== --- test/MC/RISCV/rv32c-only-valid.s +++ test/MC/RISCV/rv32c-only-valid.s @@ -1,7 +1,7 @@ # RUN: llvm-mc -triple=riscv32 -mattr=+c -riscv-no-aliases -show-encoding < %s \ # RUN: | FileCheck -check-prefixes=CHECK,CHECK-INST %s -# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+c -riscv-no-aliases < %s \ -# RUN: | llvm-objdump -d - | FileCheck -check-prefix=CHECK-INST %s +# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+c < %s \ +# RUN: | llvm-objdump -d -riscv-no-aliases - | FileCheck -check-prefix=CHECK-INST %s # RUN: not llvm-mc -triple riscv32 \ # RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \ # RUN: | FileCheck -check-prefixes=CHECK-NO-EXT %s