summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/coalesce-locals_all-features.txt21
-rw-r--r--test/passes/coalesce-locals_all-features.wast19
2 files changed, 40 insertions, 0 deletions
diff --git a/test/passes/coalesce-locals_all-features.txt b/test/passes/coalesce-locals_all-features.txt
new file mode 100644
index 000000000..f532f5d0e
--- /dev/null
+++ b/test/passes/coalesce-locals_all-features.txt
@@ -0,0 +1,21 @@
+(module
+ (type $none_=>_i32 (func (result i32)))
+ (type $i32_=>_i32 (func (param i32) (result i32)))
+ (export "foo" (func $1))
+ (func $bar (result i32)
+ (i32.const 1984)
+ )
+ (func $1 (param $0 i32) (result i32)
+ (try $try
+ (do
+ (local.set $0
+ (call $bar)
+ )
+ )
+ (catch_all
+ (unreachable)
+ )
+ )
+ (local.get $0)
+ )
+)
diff --git a/test/passes/coalesce-locals_all-features.wast b/test/passes/coalesce-locals_all-features.wast
new file mode 100644
index 000000000..ff7f04f0c
--- /dev/null
+++ b/test/passes/coalesce-locals_all-features.wast
@@ -0,0 +1,19 @@
+(module
+ (func $bar (result i32)
+ (i32.const 1984)
+ )
+ (func "foo" (param $0 i32) (result i32)
+ (local $1 i32)
+ (try
+ (do
+ (local.set $1
+ (call $bar) ;; the call may or may not throw, so we may reach the get of $1
+ )
+ )
+ (catch_all
+ (unreachable)
+ )
+ )
+ (local.get $1)
+ )
+)