summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2024-01-22 19:26:17 -0800
committerGitHub <noreply@github.com>2024-01-22 19:26:17 -0800
commitc23253fa9fb8ab49bc922cf35448ebd3cf0b6789 (patch)
tree0175bf6e0a969da4d6034b70ab7d43cea84c84eb /test
parente06e17e60cfff8a17d00202e208c11c483bedee8 (diff)
downloadbinaryen-c23253fa9fb8ab49bc922cf35448ebd3cf0b6789.tar.gz
binaryen-c23253fa9fb8ab49bc922cf35448ebd3cf0b6789.tar.bz2
binaryen-c23253fa9fb8ab49bc922cf35448ebd3cf0b6789.zip
[EH] Support Stack IR for try_table (#6231)
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/stack-ir-eh.wast61
1 files changed, 61 insertions, 0 deletions
diff --git a/test/lit/passes/stack-ir-eh.wast b/test/lit/passes/stack-ir-eh.wast
new file mode 100644
index 000000000..e06e5e517
--- /dev/null
+++ b/test/lit/passes/stack-ir-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 --optimize-stack-ir \
+;; RUN: -all --print-stack-ir | filecheck %s
+
+(module
+ ;; CHECK: (tag $e-i32 (param i32))
+ (tag $e-i32 (param i32))
+
+ ;; CHECK: (func $foo (type $0)
+ ;; CHECK-NEXT: )
+ (func $foo)
+
+ ;; CHECK: (func $test (type $0)
+ ;; CHECK-NEXT: block $outer
+ ;; CHECK-NEXT: block $l-catch (result i32)
+ ;; CHECK-NEXT: block $l-catch-ref (type $1) (result i32 exnref)
+ ;; CHECK-NEXT: block $l-catch-all
+ ;; CHECK-NEXT: block $l-catch-all-ref (result exnref)
+ ;; CHECK-NEXT: try_table (catch $e-i32 $l-catch) (catch_ref $e-i32 $l-catch-ref) (catch_all $l-catch-all) (catch_all_ref $l-catch-all-ref)
+ ;; CHECK-NEXT: call $foo
+ ;; CHECK-NEXT: end
+ ;; CHECK-NEXT: br $outer
+ ;; CHECK-NEXT: end
+ ;; CHECK-NEXT: throw_ref
+ ;; CHECK-NEXT: end
+ ;; CHECK-NEXT: br $outer
+ ;; CHECK-NEXT: end
+ ;; CHECK-NEXT: tuple.drop 2
+ ;; CHECK-NEXT: br $outer
+ ;; CHECK-NEXT: end
+ ;; CHECK-NEXT: drop
+ ;; CHECK-NEXT: end
+ ;; CHECK-NEXT: )
+ (func $test
+ (block $outer
+ (drop
+ (block $l-catch (result i32)
+ (tuple.drop 2
+ (block $l-catch-ref (result i32 exnref)
+ (block $l-catch-all
+ (throw_ref
+ (block $l-catch-all-ref (result exnref)
+ (try_table (catch $e-i32 $l-catch)
+ (catch_ref $e-i32 $l-catch-ref)
+ (catch_all $l-catch-all)
+ (catch_all_ref $l-catch-all-ref)
+ (call $foo)
+ )
+ (br $outer)
+ )
+ )
+ )
+ (br $outer)
+ )
+ )
+ (br $outer)
+ )
+ )
+ )
+ )
+)