summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/dce_all-features.txt10
-rw-r--r--test/passes/dce_all-features.wast35
2 files changed, 45 insertions, 0 deletions
diff --git a/test/passes/dce_all-features.txt b/test/passes/dce_all-features.txt
index 47b2e6cc2..e5af0bff9 100644
--- a/test/passes/dce_all-features.txt
+++ b/test/passes/dce_all-features.txt
@@ -503,6 +503,7 @@
)
(module
(type $none_=>_none (func))
+ (event $e (attr 0) (param))
(func $foo
(nop)
)
@@ -531,6 +532,15 @@
)
)
)
+ (func $throw
+ (throw $e
+ )
+ )
+ (func $rethrow
+ (rethrow
+ (ref.null)
+ )
+ )
)
(module
(type $none_=>_none (func))
diff --git a/test/passes/dce_all-features.wast b/test/passes/dce_all-features.wast
index cfdc58bbb..98b2b0ecd 100644
--- a/test/passes/dce_all-features.wast
+++ b/test/passes/dce_all-features.wast
@@ -739,6 +739,7 @@
;; reachable
(module
(func $foo)
+ (event $e (attr 0))
(func $try_unreachable
(try
@@ -767,6 +768,40 @@
)
(call $foo) ;; should be dce'd
)
+
+ (func $throw
+ (drop
+ (block $label$0 (result nullref)
+ (if
+ (i32.clz
+ (block $label$1 (result i32)
+ (throw $e)
+ )
+ )
+ (nop)
+ )
+ (ref.null)
+ )
+ )
+ )
+
+ (func $rethrow
+ (drop
+ (block $label$0 (result nullref)
+ (if
+ (i32.clz
+ (block $label$1 (result i32)
+ (rethrow
+ (ref.null)
+ )
+ )
+ )
+ (nop)
+ )
+ (ref.null)
+ )
+ )
+ )
)
;; Push-pop