diff options
author | Heejin Ahn <aheejin@gmail.com> | 2020-05-11 10:51:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 10:51:07 -0700 |
commit | 3de8c98b682e1347e5c50c58eaddc4b01f3e26ab (patch) | |
tree | c068fef90f72839106f6f15f48f34c12d526ef99 /test/passes/remove-unused-names_optimize-instructions_all-features.txt | |
parent | 91ec2ee5bedefc4736fcda78ae39298846aeeb41 (diff) | |
download | binaryen-3de8c98b682e1347e5c50c58eaddc4b01f3e26ab.tar.gz binaryen-3de8c98b682e1347e5c50c58eaddc4b01f3e26ab.tar.bz2 binaryen-3de8c98b682e1347e5c50c58eaddc4b01f3e26ab.zip |
Make try body start with 'do' (#2846)
In WebAssembly/exception-handling#52, We decided to put `try` bodies in
a `do` clause to be more consistent with `catch`.
- Before
```wast
(try
...
(catch
...
)
)
```
- After
```wast
(try
(do
...
)
(catch
...
)
)
```
Another upside of this change is when there are multiple instructions
within a `try` body, we no longer need to wrap them in a `block`.
Diffstat (limited to 'test/passes/remove-unused-names_optimize-instructions_all-features.txt')
-rw-r--r-- | test/passes/remove-unused-names_optimize-instructions_all-features.txt | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/test/passes/remove-unused-names_optimize-instructions_all-features.txt b/test/passes/remove-unused-names_optimize-instructions_all-features.txt index 84405cd17..182916755 100644 --- a/test/passes/remove-unused-names_optimize-instructions_all-features.txt +++ b/test/passes/remove-unused-names_optimize-instructions_all-features.txt @@ -12,7 +12,9 @@ (local $x3 i32) (local.set $x0 (try (result i32) - (i32.const 1) + (do + (i32.const 1) + ) (catch (drop (exnref.pop) @@ -26,7 +28,7 @@ ) (local.set $x1 (try (result i32) - (block (result i32) + (do (call $dummy) (i32.const 1) ) @@ -46,10 +48,12 @@ ) (local.set $x2 (try (result i32) - (block (result i32) + (do (try - (throw $e - (i32.const 0) + (do + (throw $e + (i32.const 0) + ) ) (catch (drop @@ -72,9 +76,11 @@ ) (local.set $x3 (try (result i32) - (block (result i32) + (do (try - (nop) + (do + (nop) + ) (catch (drop (exnref.pop) |