Verify that the instruction encoding matches what the ISA would encode.
Fixes #69
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
d0d5f3bb26
commit
43ce26e64b
21
cranelift/filetests/isa/riscv/verify-encoding.cton
Normal file
21
cranelift/filetests/isa/riscv/verify-encoding.cton
Normal file
@@ -0,0 +1,21 @@
|
||||
test verifier
|
||||
isa riscv
|
||||
|
||||
function RV32I(i32 link [%x1]) -> i32 link [%x1] {
|
||||
fn0 = function foo()
|
||||
|
||||
ebb0(v9999: i32):
|
||||
; iconst.i32 needs legalizing, so it should throw a
|
||||
[R#0,-] v1 = iconst.i32 1 ; error: Instruction failed to re-encode
|
||||
return v9999
|
||||
}
|
||||
|
||||
function RV32I(i32 link [%x1]) -> i32 link [%x1] {
|
||||
fn0 = function foo()
|
||||
|
||||
ebb0(v9999: i32):
|
||||
v1 = iconst.i32 1
|
||||
v2 = iconst.i32 2
|
||||
[R#0,-] v3 = iadd v1, v2 ; error: Instruction re-encoding
|
||||
return v9999
|
||||
}
|
||||
Reference in New Issue
Block a user