diff options
author | Alon Zakai <azakai@google.com> | 2024-06-13 12:03:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 12:03:09 -0700 |
commit | 000fa2a8ac8dd66b8ca53b0451702966d59da4d0 (patch) | |
tree | 88d0c406ee7bd11da5b800bfaff2bd7b1807b093 /test/wasm2js/refs.2asm.js | |
parent | 66610d84bc466d0826803d8e2951af48ca2f1bae (diff) | |
download | binaryen-000fa2a8ac8dd66b8ca53b0451702966d59da4d0.tar.gz binaryen-000fa2a8ac8dd66b8ca53b0451702966d59da4d0.tar.bz2 binaryen-000fa2a8ac8dd66b8ca53b0451702966d59da4d0.zip |
wasm2js: Generalize global initializer code to use the main codegen logic (#6659)
This avoids special-casing particular global init forms. After this we should
support everything in global inits that we support anywhere else.
Diffstat (limited to 'test/wasm2js/refs.2asm.js')
-rw-r--r-- | test/wasm2js/refs.2asm.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/wasm2js/refs.2asm.js b/test/wasm2js/refs.2asm.js index f538df6d6..f1d60af6c 100644 --- a/test/wasm2js/refs.2asm.js +++ b/test/wasm2js/refs.2asm.js @@ -13,6 +13,7 @@ function asmFunc(imports) { var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; var global = null; + var global_ref = use_global_ref; function null_() { return null; } @@ -42,13 +43,21 @@ function asmFunc(imports) { return temp; } + function use_global_ref(x) { + var temp = null; + temp = global_ref; + global_ref = x; + return temp; + } + return { "null_": null_, "is_null": is_null, "ref_func": ref_func, "ref_eq": ref_eq, "ref_as": ref_as, - "use_global": use_global + "use_global": use_global, + "use_global_ref": use_global_ref }; } @@ -60,3 +69,4 @@ 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; +export var use_global_ref = retasmFunc.use_global_ref; |