Files
wasmtime/cranelift/filetests/isa/riscv/verify-encoding.cton
Dan Gohman 0e57f3d0ea Add a "colocated" flag to symbol references. (#298)
This adds a "colocated" flag to function and symbolic global variables which
indicates that they are defined along with the current function, so they can
use PC-relative addressing.

This also changes the function decl syntax; the name now always precedes the
signature, and the "function" keyword is no longer included.
2018-04-13 15:00:09 -07:00

22 lines
505 B
Plaintext

test verifier
isa riscv
function %RV32I(i32 link [%x1]) -> i32 link [%x1] {
fn0 = %foo()
ebb0(v9999: i32):
; iconst.i32 needs legalizing, so it should throw a
[R#0,-] v1 = iconst.i32 0xf0f0f0f0f0 ; error: Instruction failed to re-encode
return v9999
}
function %RV32I(i32 link [%x1]) -> i32 link [%x1] {
fn0 = %foo()
ebb0(v9999: i32):
v1 = iconst.i32 1
v2 = iconst.i32 2
[R#0,-] v3 = iadd v1, v2 ; error: encoding R#00 should be R#0c
return v9999
}