Files
wasmtime/cranelift/filetests/verifier/undeclared_vmctx.clif
Dan Gohman ca9da7702e Reorganize the global value kinds. (#490)
* Reorganize the global value kinds.

This:
 - renames "deref" global values to "load" and gives it a offset that works
   like the "load" instructions' does
 - adds an explicit "iadd_imm" global value kind, which replaces the
   builtin iadd in "vmctx" and "deref" global values.
 - also renames "globalsym" to "symbol"
2018-09-04 21:09:04 -07:00

18 lines
394 B
Plaintext

test verifier
; Using a vmctx global value without declaring it first leads to an error.
function %vmglobal_err(i64) -> i64 {
gv4 = vmctx ; error: undeclared vmctx reference
ebb0(v0: i64):
v1 = global_value.i64 gv4
return v1
}
; If it is declared, all is fine.
function %vmglobal_ok(i64 vmctx) -> i64 {
gv4 = vmctx
ebb0(v0: i64):
v1 = global_value.i64 gv4
return v1
}