summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-08-23 15:05:40 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-09-07 09:55:07 -0700
commit323e32bc1ca73c92d81b7fe28fd54e62c2218801 (patch)
tree93d1394679d6eb2a2cb18b3621b2ea036f984336 /test
parente125ae76b29b84563892263663e66ff072852c99 (diff)
downloadbinaryen-323e32bc1ca73c92d81b7fe28fd54e62c2218801.tar.gz
binaryen-323e32bc1ca73c92d81b7fe28fd54e62c2218801.tar.bz2
binaryen-323e32bc1ca73c92d81b7fe28fd54e62c2218801.zip
autodrop must be run before we optimize in asm2wasm, as otherwise its input is not yet valid
then after finalizeCalls, we must autodrop again to drop things that finalizeCalls changed
Diffstat (limited to 'test')
-rw-r--r--test/emcc_hello_world.fromasm76
-rw-r--r--test/emcc_hello_world.fromasm.imprecise76
-rw-r--r--test/unit.fromasm13
-rw-r--r--test/unit.fromasm.imprecise13
4 files changed, 102 insertions, 76 deletions
diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm
index c0b245dd9..ab579533e 100644
--- a/test/emcc_hello_world.fromasm
+++ b/test/emcc_hello_world.fromasm
@@ -2729,21 +2729,23 @@
)
)
)
- (call_indirect $FUNCSIG$iiii
- (get_local $0)
- (i32.sub
- (get_local $1)
- (get_local $2)
- )
- (i32.const 1)
- (i32.add
- (i32.and
- (i32.load offset=40
- (get_local $0)
+ (drop
+ (call_indirect $FUNCSIG$iiii
+ (get_local $0)
+ (i32.sub
+ (get_local $1)
+ (get_local $2)
+ )
+ (i32.const 1)
+ (i32.add
+ (i32.and
+ (i32.load offset=40
+ (get_local $0)
+ )
+ (i32.const 7)
)
- (i32.const 7)
+ (i32.const 2)
)
- (i32.const 2)
)
)
)
@@ -7119,13 +7121,15 @@
)
(i32.const 0)
)
- (call $___fwritex
- (get_local $5)
- (i32.sub
- (get_local $75)
+ (drop
+ (call $___fwritex
(get_local $5)
+ (i32.sub
+ (get_local $75)
+ (get_local $5)
+ )
+ (get_local $0)
)
- (get_local $0)
)
)
(if
@@ -7234,17 +7238,19 @@
)
(i32.const 0)
)
- (call $___fwritex
- (get_local $1)
- (select
- (i32.const 9)
- (get_local $15)
- (i32.gt_s
- (get_local $15)
+ (drop
+ (call $___fwritex
+ (get_local $1)
+ (select
(i32.const 9)
+ (get_local $15)
+ (i32.gt_s
+ (get_local $15)
+ (i32.const 9)
+ )
)
+ (get_local $0)
)
- (get_local $0)
)
)
(set_local $1
@@ -7461,17 +7467,19 @@
)
(i32.const 0)
)
- (call $___fwritex
- (get_local $1)
- (select
- (get_local $8)
- (get_local $15)
- (i32.gt_s
- (get_local $15)
+ (drop
+ (call $___fwritex
+ (get_local $1)
+ (select
(get_local $8)
+ (get_local $15)
+ (i32.gt_s
+ (get_local $15)
+ (get_local $8)
+ )
)
+ (get_local $0)
)
- (get_local $0)
)
)
(if
diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise
index 07ee8d33f..32e34c0e9 100644
--- a/test/emcc_hello_world.fromasm.imprecise
+++ b/test/emcc_hello_world.fromasm.imprecise
@@ -2723,21 +2723,23 @@
)
)
)
- (call_indirect $FUNCSIG$iiii
- (get_local $0)
- (i32.sub
- (get_local $1)
- (get_local $2)
- )
- (i32.const 1)
- (i32.add
- (i32.and
- (i32.load offset=40
- (get_local $0)
+ (drop
+ (call_indirect $FUNCSIG$iiii
+ (get_local $0)
+ (i32.sub
+ (get_local $1)
+ (get_local $2)
+ )
+ (i32.const 1)
+ (i32.add
+ (i32.and
+ (i32.load offset=40
+ (get_local $0)
+ )
+ (i32.const 7)
)
- (i32.const 7)
+ (i32.const 2)
)
- (i32.const 2)
)
)
)
@@ -7113,13 +7115,15 @@
)
(i32.const 0)
)
- (call $___fwritex
- (get_local $5)
- (i32.sub
- (get_local $75)
+ (drop
+ (call $___fwritex
(get_local $5)
+ (i32.sub
+ (get_local $75)
+ (get_local $5)
+ )
+ (get_local $0)
)
- (get_local $0)
)
)
(if
@@ -7228,17 +7232,19 @@
)
(i32.const 0)
)
- (call $___fwritex
- (get_local $1)
- (select
- (i32.const 9)
- (get_local $15)
- (i32.gt_s
- (get_local $15)
+ (drop
+ (call $___fwritex
+ (get_local $1)
+ (select
(i32.const 9)
+ (get_local $15)
+ (i32.gt_s
+ (get_local $15)
+ (i32.const 9)
+ )
)
+ (get_local $0)
)
- (get_local $0)
)
)
(set_local $1
@@ -7455,17 +7461,19 @@
)
(i32.const 0)
)
- (call $___fwritex
- (get_local $1)
- (select
- (get_local $8)
- (get_local $15)
- (i32.gt_s
- (get_local $15)
+ (drop
+ (call $___fwritex
+ (get_local $1)
+ (select
(get_local $8)
+ (get_local $15)
+ (i32.gt_s
+ (get_local $15)
+ (get_local $8)
+ )
)
+ (get_local $0)
)
- (get_local $0)
)
)
(if
diff --git a/test/unit.fromasm b/test/unit.fromasm
index bc5281ed5..f48dfcdb2 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -491,10 +491,15 @@
)
)
(func $smallIf
- (if
- (i32.const 2)
- (call $lb
- (i32.const 3)
+ (block $do-once$0
+ (drop
+ (if
+ (i32.const 2)
+ (call $lb
+ (i32.const 3)
+ )
+ (br $do-once$0)
+ )
)
)
)
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index 945d6cc8e..06ab40915 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -473,10 +473,15 @@
)
)
(func $smallIf
- (if
- (i32.const 2)
- (call $lb
- (i32.const 3)
+ (block $do-once$0
+ (drop
+ (if
+ (i32.const 2)
+ (call $lb
+ (i32.const 3)
+ )
+ (br $do-once$0)
+ )
)
)
)