blob: 20ac5ef111115fac15c525ec309aaff90617375e [file] [log] [blame]
Lewis Revill69707552019-06-11 12:52:05 +00001; RUN: not llc -mtriple=riscv32 < %s 2>&1 | FileCheck %s
2; RUN: not llc -mtriple=riscv64 < %s 2>&1 | FileCheck %s
3
4define void @constraint_I() {
Bill Wendling41a28472019-08-03 05:52:47 +00005; CHECK: error: value out of range for constraint 'I'
Lewis Revill69707552019-06-11 12:52:05 +00006 tail call void asm sideeffect "addi a0, a0, $0", "I"(i32 2048)
Bill Wendling41a28472019-08-03 05:52:47 +00007; CHECK: error: value out of range for constraint 'I'
Lewis Revill69707552019-06-11 12:52:05 +00008 tail call void asm sideeffect "addi a0, a0, $0", "I"(i32 -2049)
9 ret void
10}
11
12define void @constraint_J() {
Bill Wendling41a28472019-08-03 05:52:47 +000013; CHECK: error: value out of range for constraint 'J'
Lewis Revill69707552019-06-11 12:52:05 +000014 tail call void asm sideeffect "addi a0, a0, $0", "J"(i32 1)
15 ret void
16}
17
18define void @constraint_K() {
Bill Wendling41a28472019-08-03 05:52:47 +000019; CHECK: error: value out of range for constraint 'K'
Lewis Revill69707552019-06-11 12:52:05 +000020 tail call void asm sideeffect "csrwi mstatus, $0", "K"(i32 32)
Bill Wendling41a28472019-08-03 05:52:47 +000021; CHECK: error: value out of range for constraint 'K'
Lewis Revill69707552019-06-11 12:52:05 +000022 tail call void asm sideeffect "csrwi mstatus, $0", "K"(i32 -1)
23 ret void
24}
Sam Elliott9e6b2e12019-07-31 09:45:55 +000025
26define 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)
31 ret void
32}