summaryrefslogtreecommitdiff
path: root/test/unit.fromasm.imprecise
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2019-01-16 13:22:39 -0800
committerGitHub <noreply@github.com>2019-01-16 13:22:39 -0800
commit777d33d40ff030f1711c40bf3cd5bc4bc36af313 (patch)
tree343d05d218b55dfd6e453f90d76d896cd84d1865 /test/unit.fromasm.imprecise
parentcbb24eb4a0810640c9dcee2f6682c64f9bc6c512 (diff)
downloadbinaryen-777d33d40ff030f1711c40bf3cd5bc4bc36af313.tar.gz
binaryen-777d33d40ff030f1711c40bf3cd5bc4bc36af313.tar.bz2
binaryen-777d33d40ff030f1711c40bf3cd5bc4bc36af313.zip
Emscripten stack simplification (#1870)
This takes advantage of the recent memory simplification in emscripten, where JS static allocation is done at compile time. That means we know the stack's initial location at compile time, and can apply it. This is the binaryen side of that: * asm2wasm support for asm.js globals with an initial value var X = Y; where Y is not 0 (which is what the stack now is). * wasm-emscripten-finalize support for a flag --initial-stack-pointer=X, and remove the old code to import the stack's initial location.
Diffstat (limited to 'test/unit.fromasm.imprecise')
-rw-r--r--test/unit.fromasm.imprecise7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index 869873ec1..7ff7a4c18 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -22,6 +22,7 @@
(global $Int (mut i32) (i32.const 0))
(global $Double (mut f64) (f64.const 0))
(global $n (mut i32) (global.get $n$asm2wasm$import))
+ (global $nonZero (mut i32) (i32.const 1337))
(global $exportedNumber i32 (i32.const 42))
(export "big_negative" (func $big_negative))
(export "pick" (func $big_negative))
@@ -1141,6 +1142,12 @@
(f64.const 1)
)
)
+ (global.set $nonZero
+ (i32.add
+ (global.get $nonZero)
+ (i32.const 1)
+ )
+ )
)
(func $vi (; 54 ;) (; has Stack IR ;) (param $0 i32)
(nop)