1 # RUN: llvm-mc %s -triple=riscv32 -mattr=+c,+f -riscv-no-aliases -show-encoding \
2 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
3 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+c,+f < %s \
4 # RUN: | llvm-objdump --mattr=+c,+f -M no-aliases -d -r - \
5 # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
6 # RUN: llvm-mc %s -triple=riscv32 -mattr=+zcf,+f -riscv-no-aliases -show-encoding \
7 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
8 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+zcf,+f < %s \
9 # RUN: | llvm-objdump --mattr=+zcf,+f -M no-aliases -d -r - \
10 # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
12 # RUN: not llvm-mc -triple riscv32 -mattr=+c \
13 # RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
14 # RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-F %s
15 # RUN: not llvm-mc -triple riscv32 -mattr=+zcf \
16 # RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
17 # RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-F %s
18 # RUN: not llvm-mc -triple riscv32 \
19 # RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
20 # RUN: | FileCheck -check-prefixes=CHECK-NO-EXT-FC %s
21 # RUN: not llvm-mc -triple riscv64 -mattr=+c,+f \
22 # RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
23 # RUN: | FileCheck -check-prefixes=CHECK-NO-RV32 %s
25 # FIXME: error messages for rv64fc are misleading
27 # CHECK-ASM-AND-OBJ: c.flwsp fs0, 252(sp)
28 # CHECK-ASM: encoding: [0x7e,0x74]
29 # CHECK-NO-EXT-F: error: instruction requires the following: 'F' (Single-Precision Floating-Point){{$}}
30 # CHECK-NO-EXT-FC: error: instruction requires the following: 'C' (Compressed Instructions) or 'Zcf' (Compressed Single-Precision Floating-Point Instructions), 'F' (Single-Precision Floating-Point){{$}}
31 # CHECK-NO-RV32: error: instruction requires the following: RV32I Base Instruction Set{{$}}
33 # CHECK-ASM-AND-OBJ: c.fswsp fa7, 252(sp)
34 # CHECK-ASM: encoding: [0xc6,0xff]
35 # CHECK-NO-EXT-F: error: instruction requires the following: 'F' (Single-Precision Floating-Point){{$}}
36 # CHECK-NO-EXT-FC: error: instruction requires the following: 'C' (Compressed Instructions) or 'Zcf' (Compressed Single-Precision Floating-Point Instructions), 'F' (Single-Precision Floating-Point){{$}}
37 # CHECK-NO-RV32: error: instruction requires the following: RV32I Base Instruction Set{{$}}
40 # CHECK-ASM-AND-OBJ: c.flw fa3, 124(a5)
41 # CHECK-ASM: encoding: [0xf4,0x7f]
42 # CHECK-NO-EXT-F: error: instruction requires the following: 'F' (Single-Precision Floating-Point){{$}}
43 # CHECK-NO-EXT-FC: error: instruction requires the following: 'C' (Compressed Instructions) or 'Zcf' (Compressed Single-Precision Floating-Point Instructions), 'F' (Single-Precision Floating-Point){{$}}
44 # CHECK-NO-RV32: error: instruction requires the following: RV32I Base Instruction Set{{$}}
46 # CHECK-ASM-AND-OBJ: c.fsw fa2, 124(a1)
47 # CHECK-ASM: encoding: [0xf0,0xfd]
48 # CHECK-NO-EXT-F: error: instruction requires the following: 'F' (Single-Precision Floating-Point){{$}}
49 # CHECK-NO-EXT-FC: error: instruction requires the following: 'C' (Compressed Instructions) or 'Zcf' (Compressed Single-Precision Floating-Point Instructions), 'F' (Single-Precision Floating-Point){{$}}
50 # CHECK-NO-RV32: error: instruction requires the following: RV32I Base Instruction Set{{$}}