1 ; RUN: not llc -mtriple=riscv32 < %s 2>&1 | FileCheck %s
2 ; RUN: not llc -mtriple=riscv64 < %s 2>&1 | FileCheck %s
4 define void @constraint_I() {
5 ; CHECK: error: value out of range for constraint 'I'
6 tail call void asm sideeffect "addi a0, a0, $0", "I"(i32 2048)
7 ; CHECK: error: value out of range for constraint 'I'
8 tail call void asm sideeffect "addi a0, a0, $0", "I"(i32 -2049)
12 define void @constraint_J() {
13 ; CHECK: error: value out of range for constraint 'J'
14 tail call void asm sideeffect "addi a0, a0, $0", "J"(i32 1)
18 define void @constraint_K() {
19 ; CHECK: error: value out of range for constraint 'K'
20 tail call void asm sideeffect "csrwi mstatus, $0", "K"(i32 32)
21 ; CHECK: error: value out of range for constraint 'K'
22 tail call void asm sideeffect "csrwi mstatus, $0", "K"(i32 -1)
26 define void @constraint_f() nounwind {
27 ; CHECK: error: couldn't allocate input reg for constraint 'f'
28 tail call void asm "fadd.s fa0, fa0, $0", "f"(float 0.0)
29 ; CHECK: error: couldn't allocate input reg for constraint 'f'
30 tail call void asm "fadd.d fa0, fa0, $0", "f"(double 0.0)
34 define void @constraint_cf() nounwind {
35 ; CHECK: error: couldn't allocate input reg for constraint 'cf'
36 tail call void asm "fadd.s fa0, fa0, $0", "^cf"(float 0.0)
37 ; CHECK: error: couldn't allocate input reg for constraint 'cf'
38 tail call void asm "fadd.d fa0, fa0, $0", "^cf"(double 0.0)
42 define void @constraint_r_fixed_vec() nounwind {
43 ; CHECK: error: couldn't allocate input reg for constraint 'r'
44 tail call void asm "add a0, a0, $0", "r"(<4 x i32> zeroinitializer)
48 define void @constraint_r_scalable_vec() nounwind {
49 ; CHECK: error: couldn't allocate input reg for constraint 'r'
50 tail call void asm "add a0, a0, $0", "r"(<vscale x 4 x i32> zeroinitializer)
54 define void @constraint_cr_fixed_vec() nounwind {
55 ; CHECK: error: couldn't allocate input reg for constraint 'cr'
56 tail call void asm "add a0, a0, $0", "^cr"(<4 x i32> zeroinitializer)
60 define void @constraint_cr_scalable_vec() nounwind {
61 ; CHECK: error: couldn't allocate input reg for constraint 'cr'
62 tail call void asm "add a0, a0, $0", "^cr"(<vscale x 4 x i32> zeroinitializer)