brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · c4fec69 Raw
57 lines · plain
1# RUN: llvm-mc %s -triple=riscv32 -mattr=+c -M no-aliases -show-encoding \2# RUN:     | FileCheck --check-prefix=CHECK-ASM %s3# RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+c < %s \4# RUN:     | llvm-objdump --mattr=+c --no-print-imm-hex -M no-aliases -d -r - \5# RUN:     | FileCheck --check-prefix=CHECK-OBJ %s6#7# RUN: not llvm-mc -triple riscv32 \8# RUN:     -M no-aliases -show-encoding < %s 2>&1 \9# RUN:     | FileCheck --check-prefix=CHECK-NO-EXT %s10# RUN: not llvm-mc -triple riscv64 -mattr=+c \11# RUN:     -M no-aliases -show-encoding < %s 2>&1 \12# RUN:     | FileCheck --check-prefix=CHECK-NO-RV32 %s13# RUN: not llvm-mc -triple riscv64 \14# RUN:     -M no-aliases -show-encoding < %s 2>&1 \15# RUN:     | FileCheck --check-prefix=CHECK-NO-RV32-AND-EXT %s16 17# CHECK-OBJ: c.jal 0x7fe18# CHECK-ASM: c.jal 204619# CHECK-ASM: encoding: [0xfd,0x2f]20# CHECK-NO-EXT: error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores){{$}}21# CHECK-NO-RV32: error: instruction requires the following: RV32I Base Instruction Set{{$}}22# CHECK-NO-RV32-AND-EXT: error: instruction requires the following: 'C' (Compressed Instructions) or 'Zca' (part of the C extension, excluding compressed floating point loads/stores), RV32I Base Instruction Set{{$}}23c.jal 204624 25# CHECK-OBJ: c.addi a1, -126# CHECK-ASM: c.addi a1, -127# CHECK-ASM: encoding: [0xfd,0x15]28c.addi a1, 0xffffffff29 30# CHECK-OBJ: c.addi16sp sp, -35231# CHECK-ASM: c.addi16sp sp, -35232# CHECK-ASM: encoding: [0x0d,0x71]33c.addi16sp sp, 0xfffffea034 35## Branch and Jump immediates are relative but printed as their absolute address36## when disassembling.37 38# CHECK-OBJ: c.beqz a2, 0xffffff0639# CHECK-ASM: c.beqz a2, -25640# CHECK-ASM: encoding: [0x01,0xd2]41c.beqz a2, 0xffffff0042 43# CHECK-OBJ: c.beqz a0, 0xffffff1644# CHECK-ASM: .insn cb 1, 6, a0, -24245# CHECK-ASM: encoding: [0x19,0xd5]46.insn cb 1, 6, a0, 0xffffff0e47 48# CHECK-OBJ: c.jal 0xfffffab449# CHECK-ASM: c.jal -136650# CHECK-ASM: encoding: [0x6d,0x34]51c.jal 0xfffffaaa52 53# CHECK-OBJ: c.j 0xfffffcd854# CHECK-ASM: .insn cj 1, 5, -82055# CHECK-ASM: encoding: [0xf1,0xb1]56.insn cj 1, 5, 0xfffffccc57