Lewis Revill | 6970755 | 2019-06-11 12:52:05 +0000 | [diff] [blame] | 1 | ; RUN: not llc -mtriple=riscv32 < %s 2>&1 | FileCheck %s |
| 2 | ; RUN: not llc -mtriple=riscv64 < %s 2>&1 | FileCheck %s |
| 3 | |
| 4 | define void @constraint_I() { |
Bill Wendling | 41a2847 | 2019-08-03 05:52:47 +0000 | [diff] [blame] | 5 | ; CHECK: error: value out of range for constraint 'I' |
Lewis Revill | 6970755 | 2019-06-11 12:52:05 +0000 | [diff] [blame] | 6 | tail call void asm sideeffect "addi a0, a0, $0", "I"(i32 2048) |
Bill Wendling | 41a2847 | 2019-08-03 05:52:47 +0000 | [diff] [blame] | 7 | ; CHECK: error: value out of range for constraint 'I' |
Lewis Revill | 6970755 | 2019-06-11 12:52:05 +0000 | [diff] [blame] | 8 | tail call void asm sideeffect "addi a0, a0, $0", "I"(i32 -2049) |
| 9 | ret void |
| 10 | } |
| 11 | |
| 12 | define void @constraint_J() { |
Bill Wendling | 41a2847 | 2019-08-03 05:52:47 +0000 | [diff] [blame] | 13 | ; CHECK: error: value out of range for constraint 'J' |
Lewis Revill | 6970755 | 2019-06-11 12:52:05 +0000 | [diff] [blame] | 14 | tail call void asm sideeffect "addi a0, a0, $0", "J"(i32 1) |
| 15 | ret void |
| 16 | } |
| 17 | |
| 18 | define void @constraint_K() { |
Bill Wendling | 41a2847 | 2019-08-03 05:52:47 +0000 | [diff] [blame] | 19 | ; CHECK: error: value out of range for constraint 'K' |
Lewis Revill | 6970755 | 2019-06-11 12:52:05 +0000 | [diff] [blame] | 20 | tail call void asm sideeffect "csrwi mstatus, $0", "K"(i32 32) |
Bill Wendling | 41a2847 | 2019-08-03 05:52:47 +0000 | [diff] [blame] | 21 | ; CHECK: error: value out of range for constraint 'K' |
Lewis Revill | 6970755 | 2019-06-11 12:52:05 +0000 | [diff] [blame] | 22 | tail call void asm sideeffect "csrwi mstatus, $0", "K"(i32 -1) |
| 23 | ret void |
| 24 | } |
Sam Elliott | 9e6b2e1 | 2019-07-31 09:45:55 +0000 | [diff] [blame] | 25 | |
| 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) |
| 31 | ret void |
| 32 | } |