* 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"
18 lines
394 B
Plaintext
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
|
|
}
|