summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/simplify-locals_all-features.txt46
-rw-r--r--test/passes/simplify-locals_all-features.wast41
2 files changed, 87 insertions, 0 deletions
diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt
index d5937fabb..4a003360d 100644
--- a/test/passes/simplify-locals_all-features.txt
+++ b/test/passes/simplify-locals_all-features.txt
@@ -1892,3 +1892,49 @@
(local.get $0)
)
)
+(module
+ (type $none_=>_none (func))
+ (type $exnref_=>_none (func (param exnref)))
+ (type $none_=>_exnref (func (result exnref)))
+ (event $event$0 (attr 0) (param))
+ (event $event$1 (attr 0) (param exnref))
+ (func $unoptimizable-br_on_exn-block (result exnref)
+ (local $0 exnref)
+ (block $label$0
+ (local.set $0
+ (br_on_exn $label$0 $event$0
+ (ref.null)
+ )
+ )
+ )
+ (local.get $0)
+ )
+ (func $br_on_exn-trap
+ (local $0 exnref)
+ (drop
+ (block $label$1 (result exnref)
+ (br_on_exn $label$1 $event$1
+ (ref.null)
+ )
+ )
+ )
+ )
+ (func $rethrow-trap
+ (local $0 i32)
+ (drop
+ (block $label$1 (result i32)
+ (try
+ (do
+ (rethrow
+ (ref.null)
+ )
+ )
+ (catch
+ (nop)
+ )
+ )
+ (i32.const 0)
+ )
+ )
+ )
+)
diff --git a/test/passes/simplify-locals_all-features.wast b/test/passes/simplify-locals_all-features.wast
index a819dda15..bfe86f448 100644
--- a/test/passes/simplify-locals_all-features.wast
+++ b/test/passes/simplify-locals_all-features.wast
@@ -1671,3 +1671,44 @@
(local.get $1)
)
)
+(module
+ (event $event$0 (attr 0) (param))
+ (func $unoptimizable-br_on_exn-block (result exnref) (local $0 exnref)
+ (block $label$0
+ (local.set $0
+ ;; br_on_exn's target block cannot be optimized to have a return value
+ (br_on_exn $label$0 $event$0
+ (ref.null)
+ )
+ )
+ )
+ (local.get $0)
+ )
+
+ (event $event$1 (attr 0) (param exnref))
+ (func $br_on_exn-trap (local $0 exnref)
+ ;; This dead local.set cannot be replaced with a nop because br_on_exn can
+ ;; trap.
+ (local.set $0
+ (block $label$1 (result exnref)
+ (br_on_exn $label$1 $event$1
+ (ref.null)
+ )
+ )
+ )
+ )
+
+ (func $rethrow-trap (local $0 i32)
+ ;; This dead local.set cannot be replaced with a nop because rethrow can
+ ;; trap.
+ (local.set $0
+ (block $label$1 (result i32)
+ (try
+ (do (rethrow (ref.null)))
+ (catch)
+ )
+ (i32.const 0)
+ )
+ )
+ )
+)