summaryrefslogtreecommitdiff
path: root/test/lit/passes/stack-ir-roundtrip-eh.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/stack-ir-roundtrip-eh.wast')
-rw-r--r--test/lit/passes/stack-ir-roundtrip-eh.wast61
1 files changed, 61 insertions, 0 deletions
diff --git a/test/lit/passes/stack-ir-roundtrip-eh.wast b/test/lit/passes/stack-ir-roundtrip-eh.wast
new file mode 100644
index 000000000..b9bb22d3e
--- /dev/null
+++ b/test/lit/passes/stack-ir-roundtrip-eh.wast
@@ -0,0 +1,61 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
+;; RUN: wasm-opt %s --generate-stack-ir --roundtrip -all -S -o - | filecheck %s
+
+(module
+ (event $event (attr 0) (param i32))
+ ;; CHECK: (func $delegate-child
+ ;; CHECK-NEXT: (try $label$9
+ ;; CHECK-NEXT: (do
+ ;; CHECK-NEXT: (try $label$7
+ ;; CHECK-NEXT: (do
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (catch $event$0
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (pop i32)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (try $label$6
+ ;; CHECK-NEXT: (do
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (delegate 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (catch $event$0
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (pop i32)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $delegate-child
+ (try
+ (do
+ (try
+ (do)
+ (catch $event
+ (drop
+ (pop i32)
+ )
+ (try
+ (do)
+ ;; the binary writer must properly handle this delegate which is
+ ;; the child of other try's, and not get confused by their
+ ;; information on the stack (this is a regression test for us
+ ;; properly ending the scope with a delegate and popping the
+ ;; relevant stack).
+ (delegate 2)
+ )
+ )
+ )
+ )
+ (catch $event
+ (drop
+ (pop i32)
+ )
+ )
+ )
+ )
+)