forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EH] Support Stack IR for try_table (WebAssembly#6231)
- Loading branch information
1 parent
9dda6f9
commit f9948a0
Showing
5 changed files
with
102 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
) | ||
) | ||
) | ||
) | ||
) |