summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit.asm.js17
-rw-r--r--test/unit.fromasm17
-rw-r--r--test/unit.fromasm.imprecise17
-rw-r--r--test/unit.fromasm.imprecise.no-opts28
-rw-r--r--test/unit.fromasm.no-opts28
5 files changed, 107 insertions, 0 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js
index 5833d2fd8..0decc886c 100644
--- a/test/unit.asm.js
+++ b/test/unit.asm.js
@@ -540,6 +540,23 @@ function asm(global, env, buffer) {
}
}
+ function __Z12multi_varargiz($0) {
+ $0 = $0|0;
+ var $2 = 0, $$06$i4 = 0, $exitcond$i6 = 0, $12 = 0, $20 = 0;
+ if ($2) {
+ while(1) {
+ $12 = $$06$i4;
+ if ($exitcond$i6) {
+ break;
+ } else {
+ $$06$i4 = $20;
+ }
+ }
+ } else {
+ lb(1) | 0; // returns a value, and the while is unreachable
+ }
+ }
+
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 77e5a9eb1..773cbbd9d 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -990,4 +990,21 @@
(br $while-in$1)
)
)
+ (func $__Z12multi_varargiz (param $0 i32)
+ (local $1 i32)
+ (local $2 i32)
+ (if
+ (get_local $1)
+ (loop $while-in$1
+ (br_if $while-in$1
+ (i32.eqz
+ (get_local $2)
+ )
+ )
+ )
+ (call $lb
+ (i32.const 1)
+ )
+ )
+ )
)
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index 35aa3e4f3..80e34dfb9 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -971,4 +971,21 @@
(br $while-in$1)
)
)
+ (func $__Z12multi_varargiz (param $0 i32)
+ (local $1 i32)
+ (local $2 i32)
+ (if
+ (get_local $1)
+ (loop $while-in$1
+ (br_if $while-in$1
+ (i32.eqz
+ (get_local $2)
+ )
+ )
+ )
+ (call $lb
+ (i32.const 1)
+ )
+ )
+ )
)
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts
index 7808b6cf2..3e532ef2a 100644
--- a/test/unit.fromasm.imprecise.no-opts
+++ b/test/unit.fromasm.imprecise.no-opts
@@ -1549,4 +1549,32 @@
)
)
)
+ (func $__Z12multi_varargiz (param $$0 i32)
+ (local $$2 i32)
+ (local $$$06$i4 i32)
+ (local $$exitcond$i6 i32)
+ (local $$12 i32)
+ (local $$20 i32)
+ (if
+ (get_local $$2)
+ (loop $while-in$1
+ (block $while-out$0
+ (set_local $$12
+ (get_local $$$06$i4)
+ )
+ (if
+ (get_local $$exitcond$i6)
+ (br $while-out$0)
+ (set_local $$$06$i4
+ (get_local $$20)
+ )
+ )
+ (br $while-in$1)
+ )
+ )
+ (call $lb
+ (i32.const 1)
+ )
+ )
+ )
)
diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts
index 22528323a..d2c1beec7 100644
--- a/test/unit.fromasm.no-opts
+++ b/test/unit.fromasm.no-opts
@@ -1555,4 +1555,32 @@
)
)
)
+ (func $__Z12multi_varargiz (param $$0 i32)
+ (local $$2 i32)
+ (local $$$06$i4 i32)
+ (local $$exitcond$i6 i32)
+ (local $$12 i32)
+ (local $$20 i32)
+ (if
+ (get_local $$2)
+ (loop $while-in$1
+ (block $while-out$0
+ (set_local $$12
+ (get_local $$$06$i4)
+ )
+ (if
+ (get_local $$exitcond$i6)
+ (br $while-out$0)
+ (set_local $$$06$i4
+ (get_local $$20)
+ )
+ )
+ (br $while-in$1)
+ )
+ )
+ (call $lb
+ (i32.const 1)
+ )
+ )
+ )
)