summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/vacuum.txt10
-rw-r--r--test/passes/vacuum.wast12
-rw-r--r--test/unit.asm.js14
-rw-r--r--test/unit.fromasm13
-rw-r--r--test/unit.fromasm.imprecise13
-rw-r--r--test/unit.fromasm.imprecise.no-opts19
-rw-r--r--test/unit.fromasm.no-opts19
7 files changed, 100 insertions, 0 deletions
diff --git a/test/passes/vacuum.txt b/test/passes/vacuum.txt
index c2fb9fc29..6b5d63b2a 100644
--- a/test/passes/vacuum.txt
+++ b/test/passes/vacuum.txt
@@ -207,4 +207,14 @@
(func $relooperJumpThreading3 (type $0)
(nop)
)
+ (func $if2drops (type $3) (result i32)
+ (drop
+ (if
+ (i32.const 1)
+ (call $if2drops)
+ (call $if2drops)
+ )
+ )
+ (i32.const 2)
+ )
)
diff --git a/test/passes/vacuum.wast b/test/passes/vacuum.wast
index ecc176385..3584df3ff 100644
--- a/test/passes/vacuum.wast
+++ b/test/passes/vacuum.wast
@@ -412,4 +412,16 @@
)
)
)
+ (func $if2drops (result i32)
+ (if
+ (i32.const 1)
+ (drop
+ (call $if2drops)
+ )
+ (drop
+ (call $if2drops)
+ )
+ )
+ (i32.const 2)
+ )
)
diff --git a/test/unit.asm.js b/test/unit.asm.js
index 931a75191..7b4b2a96f 100644
--- a/test/unit.asm.js
+++ b/test/unit.asm.js
@@ -587,6 +587,20 @@ function asm(global, env, buffer) {
return;
}
+ function dropIgnoredImportsInIf($0,$1,$2) {
+ $0 = $0|0;
+ $1 = $1|0;
+ $2 = $2|0;
+ do {
+ if ($0) {
+ lb($1 | 0) | 0;
+ } else {
+ lb($2 | 0) | 0;
+ }
+ } while(0);
+ return;
+ }
+
var FUNCTION_TABLE_a = [ z, big_negative, z, z ];
var FUNCTION_TABLE_b = [ w, w, importedDoubles, w ];
var FUNCTION_TABLE_c = [ z, cneg ];
diff --git a/test/unit.fromasm b/test/unit.fromasm
index c4af783eb..123e087e6 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -1031,4 +1031,17 @@
)
)
)
+ (func $dropIgnoredImportsInIf (param $0 i32) (param $1 i32) (param $2 i32)
+ (drop
+ (if
+ (get_local $0)
+ (call $lb
+ (get_local $1)
+ )
+ (call $lb
+ (get_local $2)
+ )
+ )
+ )
+ )
)
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index 91e75d5c6..b170c8b82 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -1012,4 +1012,17 @@
)
)
)
+ (func $dropIgnoredImportsInIf (param $0 i32) (param $1 i32) (param $2 i32)
+ (drop
+ (if
+ (get_local $0)
+ (call $lb
+ (get_local $1)
+ )
+ (call $lb
+ (get_local $2)
+ )
+ )
+ )
+ )
)
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts
index ffcd9f449..913920f8b 100644
--- a/test/unit.fromasm.imprecise.no-opts
+++ b/test/unit.fromasm.imprecise.no-opts
@@ -1644,4 +1644,23 @@
)
(return)
)
+ (func $dropIgnoredImportsInIf (param $$0 i32) (param $$1 i32) (param $$2 i32)
+ (block $do-once$0
+ (if
+ (get_local $$0)
+ (drop
+ (call $lb
+ (get_local $$1)
+ )
+ )
+ (drop
+ (call $lb
+ (get_local $$2)
+ )
+ )
+ )
+ (nop)
+ )
+ (return)
+ )
)
diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts
index a8ca0e47a..21e7ea79e 100644
--- a/test/unit.fromasm.no-opts
+++ b/test/unit.fromasm.no-opts
@@ -1650,4 +1650,23 @@
)
(return)
)
+ (func $dropIgnoredImportsInIf (param $$0 i32) (param $$1 i32) (param $$2 i32)
+ (block $do-once$0
+ (if
+ (get_local $$0)
+ (drop
+ (call $lb
+ (get_local $$1)
+ )
+ )
+ (drop
+ (call $lb
+ (get_local $$2)
+ )
+ )
+ )
+ (nop)
+ )
+ (return)
+ )
)