summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/generate-stack-ir_roundtrip_all-features.txt32
-rw-r--r--test/passes/generate-stack-ir_roundtrip_all-features.wast31
2 files changed, 63 insertions, 0 deletions
diff --git a/test/passes/generate-stack-ir_roundtrip_all-features.txt b/test/passes/generate-stack-ir_roundtrip_all-features.txt
new file mode 100644
index 000000000..3d06adff1
--- /dev/null
+++ b/test/passes/generate-stack-ir_roundtrip_all-features.txt
@@ -0,0 +1,32 @@
+(module
+ (type $none_=>_none (func))
+ (type $i32_=>_none (func (param i32)))
+ (event $event$0 (attr 0) (param i32))
+ (func $delegate-child
+ (try $label$9
+ (do
+ (try $label$7
+ (do
+ (nop)
+ )
+ (catch $event$0
+ (drop
+ (pop i32)
+ )
+ (try $label$6
+ (do
+ (nop)
+ )
+ (delegate 2)
+ )
+ )
+ )
+ )
+ (catch $event$0
+ (drop
+ (pop i32)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/generate-stack-ir_roundtrip_all-features.wast b/test/passes/generate-stack-ir_roundtrip_all-features.wast
new file mode 100644
index 000000000..dc6c68d67
--- /dev/null
+++ b/test/passes/generate-stack-ir_roundtrip_all-features.wast
@@ -0,0 +1,31 @@
+(module
+ (event $event (attr 0) (param i32))
+ (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)
+ )
+ )
+ )
+ )
+)
+