summaryrefslogtreecommitdiff
path: root/test/wasm2js/refs.2asm.js.opt
diff options
context:
space:
mode:
Diffstat (limited to 'test/wasm2js/refs.2asm.js.opt')
-rw-r--r--test/wasm2js/refs.2asm.js.opt20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/wasm2js/refs.2asm.js.opt b/test/wasm2js/refs.2asm.js.opt
index e38afe1cf..251e63475 100644
--- a/test/wasm2js/refs.2asm.js.opt
+++ b/test/wasm2js/refs.2asm.js.opt
@@ -1,4 +1,6 @@
+function wasm2js_trap() { throw new Error('abort'); }
+
function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
@@ -10,6 +12,7 @@ function asmFunc(imports) {
var Math_ceil = Math.ceil;
var Math_trunc = Math.trunc;
var Math_sqrt = Math.sqrt;
+ var global = null;
function null_() {
return null;
}
@@ -26,11 +29,24 @@ function asmFunc(imports) {
return $0 == $1 | 0;
}
+ function ref_as($0) {
+ return $0 || wasm2js_trap();
+ }
+
+ function use_global($0) {
+ var $1 = null;
+ $1 = global;
+ global = $0;
+ return $1;
+ }
+
return {
"null_": null_,
"is_null": is_null,
"ref_func": ref_func,
- "ref_eq": ref_eq
+ "ref_eq": ref_eq,
+ "ref_as": ref_as,
+ "use_global": use_global
};
}
@@ -40,3 +56,5 @@ export var null_ = retasmFunc.null_;
export var is_null = retasmFunc.is_null;
export var ref_func = retasmFunc.ref_func;
export var ref_eq = retasmFunc.ref_eq;
+export var ref_as = retasmFunc.ref_as;
+export var use_global = retasmFunc.use_global;