summaryrefslogtreecommitdiff
path: root/test/lit/basic/exception-handling.wast
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-11-26 21:57:29 -0800
committerGitHub <noreply@github.com>2024-11-26 21:57:29 -0800
commitf8e1622bf0835dec2bb97bcb73281d34dbde4e2d (patch)
tree76bfc786e8dc113005be6167721b94ae4639e137 /test/lit/basic/exception-handling.wast
parent6f0f2e00521843118b63f41732dc2eb86d39fa09 (diff)
downloadbinaryen-f8e1622bf0835dec2bb97bcb73281d34dbde4e2d.tar.gz
binaryen-f8e1622bf0835dec2bb97bcb73281d34dbde4e2d.tar.bz2
binaryen-f8e1622bf0835dec2bb97bcb73281d34dbde4e2d.zip
Use IRBuilder in the binary parser (#6963)
IRBuilder is a utility for turning arbitrary valid streams of Wasm instructions into valid Binaryen IR. It is already used in the text parser, so now use it in the binary parser as well. Since the IRBuilder API for building each intruction requires only the information that the binary and text formats include as immediates to that instruction, the parser is now much simpler than before. In particular, it does not need to manage a stack of instructions to figure out what the children of each expression should be; IRBuilder handles this instead. There are some differences between the IR constructed by IRBuilder and the IR the binary parser constructed before this change. Most importantly, IRBuilder generates better multivalue code because it avoids eagerly breaking up multivalue results into individual components that might need to be immediately reassembled into a tuple. It also parses try-delegate more correctly, allowing the delegate to target arbitrary labels, not just other `try`s. There are also a couple superficial differences in the generated label and scratch local names. As part of this change, add support for recording binary source locations in IRBuilder.
Diffstat (limited to 'test/lit/basic/exception-handling.wast')
-rw-r--r--test/lit/basic/exception-handling.wast576
1 files changed, 290 insertions, 286 deletions
diff --git a/test/lit/basic/exception-handling.wast b/test/lit/basic/exception-handling.wast
index 97be09c04..41c10f631 100644
--- a/test/lit/basic/exception-handling.wast
+++ b/test/lit/basic/exception-handling.wast
@@ -147,6 +147,7 @@
;; CHECK-BIN-NEXT: (try_table
;; CHECK-BIN-NEXT: (throw $e-empty)
;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (unreachable)
;; CHECK-BIN-NEXT: )
(func $catchless-try-table
(try_table)
@@ -165,12 +166,13 @@
;; CHECK-TEXT-NEXT: )
;; CHECK-TEXT-NEXT: )
;; CHECK-BIN: (func $simple-try-table-and-throw (type $4) (result i32)
- ;; CHECK-BIN-NEXT: (block $label$1 (result i32)
- ;; CHECK-BIN-NEXT: (try_table (catch $e-i32 $label$1)
+ ;; CHECK-BIN-NEXT: (block $block (result i32)
+ ;; CHECK-BIN-NEXT: (try_table (catch $e-i32 $block)
;; CHECK-BIN-NEXT: (throw $e-i32
;; CHECK-BIN-NEXT: (i32.const 0)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (unreachable)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
(func $simple-try-table-and-throw (result i32)
@@ -194,12 +196,13 @@
;; CHECK-TEXT-NEXT: )
;; CHECK-BIN: (func $try-table-and-throw-ref (type $0)
;; CHECK-BIN-NEXT: (throw_ref
- ;; CHECK-BIN-NEXT: (block $label$1 (result exnref)
- ;; CHECK-BIN-NEXT: (try_table (catch_all_ref $label$1)
+ ;; CHECK-BIN-NEXT: (block $block (result exnref)
+ ;; CHECK-BIN-NEXT: (try_table (catch_all_ref $block)
;; CHECK-BIN-NEXT: (throw $e-i64
;; CHECK-BIN-NEXT: (i64.const 0)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (unreachable)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
@@ -233,65 +236,64 @@
;; CHECK-TEXT-NEXT: )
;; CHECK-TEXT-NEXT: )
;; CHECK-BIN: (func $try-table-multivalue-tag (type $0)
- ;; CHECK-BIN-NEXT: (local $0 (tuple i32 i64))
- ;; CHECK-BIN-NEXT: (local $1 i32)
- ;; CHECK-BIN-NEXT: (local $2 (tuple i32 i64 exnref))
- ;; CHECK-BIN-NEXT: (local $3 i64)
- ;; CHECK-BIN-NEXT: (local $4 i32)
- ;; CHECK-BIN-NEXT: (block $label$1
- ;; CHECK-BIN-NEXT: (local.set $2
- ;; CHECK-BIN-NEXT: (block $label$2 (type $2) (result i32 i64 exnref)
- ;; CHECK-BIN-NEXT: (local.set $0
- ;; CHECK-BIN-NEXT: (block $label$3 (type $1) (result i32 i64)
- ;; CHECK-BIN-NEXT: (try_table (catch $e-i32-i64 $label$3) (catch_ref $e-i32-i64 $label$2)
- ;; CHECK-BIN-NEXT: (throw $e-i32-i64
- ;; CHECK-BIN-NEXT: (i32.const 0)
- ;; CHECK-BIN-NEXT: (i64.const 0)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (drop
- ;; CHECK-BIN-NEXT: (block (result i32)
- ;; CHECK-BIN-NEXT: (local.set $1
- ;; CHECK-BIN-NEXT: (tuple.extract 2 0
- ;; CHECK-BIN-NEXT: (local.get $0)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (drop
- ;; CHECK-BIN-NEXT: (tuple.extract 2 1
- ;; CHECK-BIN-NEXT: (local.get $0)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (local.get $1)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (br $label$1)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (local $scratch (tuple i32 i64))
+ ;; CHECK-BIN-NEXT: (local $scratch_1 i32)
+ ;; CHECK-BIN-NEXT: (local $scratch_2 (tuple i32 i64 exnref))
+ ;; CHECK-BIN-NEXT: (local $scratch_3 i64)
+ ;; CHECK-BIN-NEXT: (local $scratch_4 i32)
+ ;; CHECK-BIN-NEXT: (block $block2
;; CHECK-BIN-NEXT: (drop
;; CHECK-BIN-NEXT: (block (result i32)
- ;; CHECK-BIN-NEXT: (local.set $4
+ ;; CHECK-BIN-NEXT: (local.set $scratch_4
;; CHECK-BIN-NEXT: (tuple.extract 3 0
- ;; CHECK-BIN-NEXT: (local.get $2)
+ ;; CHECK-BIN-NEXT: (local.tee $scratch_2
+ ;; CHECK-BIN-NEXT: (block $block1 (type $2) (result i32 i64 exnref)
+ ;; CHECK-BIN-NEXT: (drop
+ ;; CHECK-BIN-NEXT: (block (result i32)
+ ;; CHECK-BIN-NEXT: (local.set $scratch_1
+ ;; CHECK-BIN-NEXT: (tuple.extract 2 0
+ ;; CHECK-BIN-NEXT: (local.tee $scratch
+ ;; CHECK-BIN-NEXT: (block $block (type $1) (result i32 i64)
+ ;; CHECK-BIN-NEXT: (try_table (catch $e-i32-i64 $block) (catch_ref $e-i32-i64 $block1)
+ ;; CHECK-BIN-NEXT: (throw $e-i32-i64
+ ;; CHECK-BIN-NEXT: (i32.const 0)
+ ;; CHECK-BIN-NEXT: (i64.const 0)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (unreachable)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (drop
+ ;; CHECK-BIN-NEXT: (tuple.extract 2 1
+ ;; CHECK-BIN-NEXT: (local.get $scratch)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (local.get $scratch_1)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (br $block2)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: (drop
;; CHECK-BIN-NEXT: (block (result i64)
- ;; CHECK-BIN-NEXT: (local.set $3
+ ;; CHECK-BIN-NEXT: (local.set $scratch_3
;; CHECK-BIN-NEXT: (tuple.extract 3 1
- ;; CHECK-BIN-NEXT: (local.get $2)
+ ;; CHECK-BIN-NEXT: (local.get $scratch_2)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: (drop
;; CHECK-BIN-NEXT: (tuple.extract 3 2
- ;; CHECK-BIN-NEXT: (local.get $2)
+ ;; CHECK-BIN-NEXT: (local.get $scratch_2)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (local.get $3)
+ ;; CHECK-BIN-NEXT: (local.get $scratch_3)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (local.get $4)
+ ;; CHECK-BIN-NEXT: (local.get $scratch_4)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
@@ -338,25 +340,25 @@
;; CHECK-TEXT-NEXT: )
;; CHECK-TEXT-NEXT: )
;; CHECK-BIN: (func $try-table-all-catch-clauses-empty-tag (type $0)
- ;; CHECK-BIN-NEXT: (block $label$1
- ;; CHECK-BIN-NEXT: (block $label$2
+ ;; CHECK-BIN-NEXT: (block $block4
+ ;; CHECK-BIN-NEXT: (block $block
;; CHECK-BIN-NEXT: (drop
- ;; CHECK-BIN-NEXT: (block $label$3 (result exnref)
- ;; CHECK-BIN-NEXT: (block $label$4
+ ;; CHECK-BIN-NEXT: (block $block1 (result exnref)
+ ;; CHECK-BIN-NEXT: (block $block2
;; CHECK-BIN-NEXT: (throw_ref
- ;; CHECK-BIN-NEXT: (block $label$5 (result exnref)
- ;; CHECK-BIN-NEXT: (try_table (catch $e-empty $label$2) (catch_ref $e-empty $label$3) (catch_all $label$4) (catch_all_ref $label$5)
+ ;; CHECK-BIN-NEXT: (block $block3 (result exnref)
+ ;; CHECK-BIN-NEXT: (try_table (catch $e-empty $block) (catch_ref $e-empty $block1) (catch_all $block2) (catch_all_ref $block3)
;; CHECK-BIN-NEXT: (call $foo)
;; CHECK-BIN-NEXT: (call $foo)
;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (br $label$1)
+ ;; CHECK-BIN-NEXT: (br $block4)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (br $label$1)
+ ;; CHECK-BIN-NEXT: (br $block4)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (br $label$1)
+ ;; CHECK-BIN-NEXT: (br $block4)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
@@ -415,43 +417,42 @@
;; CHECK-TEXT-NEXT: )
;; CHECK-TEXT-NEXT: )
;; CHECK-BIN: (func $try-table-all-catch-clauses-i32-tag (type $0)
- ;; CHECK-BIN-NEXT: (local $0 (tuple i32 exnref))
- ;; CHECK-BIN-NEXT: (local $1 i32)
- ;; CHECK-BIN-NEXT: (block $label$1
+ ;; CHECK-BIN-NEXT: (local $scratch (tuple i32 exnref))
+ ;; CHECK-BIN-NEXT: (local $scratch_1 i32)
+ ;; CHECK-BIN-NEXT: (block $block4
;; CHECK-BIN-NEXT: (drop
- ;; CHECK-BIN-NEXT: (block $label$2 (result i32)
- ;; CHECK-BIN-NEXT: (local.set $0
- ;; CHECK-BIN-NEXT: (block $label$3 (type $5) (result i32 exnref)
- ;; CHECK-BIN-NEXT: (block $label$4
- ;; CHECK-BIN-NEXT: (throw_ref
- ;; CHECK-BIN-NEXT: (block $label$5 (result exnref)
- ;; CHECK-BIN-NEXT: (try_table (catch $e-i32 $label$2) (catch_ref $e-i32 $label$3) (catch_all $label$4) (catch_all_ref $label$5)
- ;; CHECK-BIN-NEXT: (call $foo)
- ;; CHECK-BIN-NEXT: (call $foo)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (br $label$1)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (br $label$1)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (block $block (result i32)
;; CHECK-BIN-NEXT: (drop
;; CHECK-BIN-NEXT: (block (result i32)
- ;; CHECK-BIN-NEXT: (local.set $1
+ ;; CHECK-BIN-NEXT: (local.set $scratch_1
;; CHECK-BIN-NEXT: (tuple.extract 2 0
- ;; CHECK-BIN-NEXT: (local.get $0)
+ ;; CHECK-BIN-NEXT: (local.tee $scratch
+ ;; CHECK-BIN-NEXT: (block $block1 (type $5) (result i32 exnref)
+ ;; CHECK-BIN-NEXT: (block $block2
+ ;; CHECK-BIN-NEXT: (throw_ref
+ ;; CHECK-BIN-NEXT: (block $block3 (result exnref)
+ ;; CHECK-BIN-NEXT: (try_table (catch $e-i32 $block) (catch_ref $e-i32 $block1) (catch_all $block2) (catch_all_ref $block3)
+ ;; CHECK-BIN-NEXT: (call $foo)
+ ;; CHECK-BIN-NEXT: (call $foo)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (br $block4)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (br $block4)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: (drop
;; CHECK-BIN-NEXT: (tuple.extract 2 1
- ;; CHECK-BIN-NEXT: (local.get $0)
+ ;; CHECK-BIN-NEXT: (local.get $scratch)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (local.get $1)
+ ;; CHECK-BIN-NEXT: (local.get $scratch_1)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (br $label$1)
+ ;; CHECK-BIN-NEXT: (br $block4)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
@@ -513,71 +514,69 @@
;; CHECK-TEXT-NEXT: )
;; CHECK-TEXT-NEXT: )
;; CHECK-BIN: (func $try-table-all-catch-clauses-multivalue-tag (type $0)
- ;; CHECK-BIN-NEXT: (local $0 (tuple i32 i64 exnref))
- ;; CHECK-BIN-NEXT: (local $1 i64)
- ;; CHECK-BIN-NEXT: (local $2 i32)
- ;; CHECK-BIN-NEXT: (local $3 (tuple i32 i64))
- ;; CHECK-BIN-NEXT: (local $4 i32)
- ;; CHECK-BIN-NEXT: (block $label$1
- ;; CHECK-BIN-NEXT: (local.set $3
- ;; CHECK-BIN-NEXT: (block $label$2 (type $1) (result i32 i64)
- ;; CHECK-BIN-NEXT: (local.set $0
- ;; CHECK-BIN-NEXT: (block $label$3 (type $2) (result i32 i64 exnref)
- ;; CHECK-BIN-NEXT: (block $label$4
- ;; CHECK-BIN-NEXT: (throw_ref
- ;; CHECK-BIN-NEXT: (block $label$5 (result exnref)
- ;; CHECK-BIN-NEXT: (try_table (catch $e-i32-i64 $label$2) (catch_ref $e-i32-i64 $label$3) (catch_all $label$4) (catch_all_ref $label$5)
- ;; CHECK-BIN-NEXT: (call $foo)
- ;; CHECK-BIN-NEXT: (call $foo)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (br $label$1)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (br $label$1)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (drop
- ;; CHECK-BIN-NEXT: (block (result i32)
- ;; CHECK-BIN-NEXT: (local.set $2
- ;; CHECK-BIN-NEXT: (tuple.extract 3 0
- ;; CHECK-BIN-NEXT: (local.get $0)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (drop
- ;; CHECK-BIN-NEXT: (block (result i64)
- ;; CHECK-BIN-NEXT: (local.set $1
- ;; CHECK-BIN-NEXT: (tuple.extract 3 1
- ;; CHECK-BIN-NEXT: (local.get $0)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (local $scratch (tuple i32 i64 exnref))
+ ;; CHECK-BIN-NEXT: (local $scratch_1 i64)
+ ;; CHECK-BIN-NEXT: (local $scratch_2 i32)
+ ;; CHECK-BIN-NEXT: (local $scratch_3 (tuple i32 i64))
+ ;; CHECK-BIN-NEXT: (local $scratch_4 i32)
+ ;; CHECK-BIN-NEXT: (block $block4
+ ;; CHECK-BIN-NEXT: (drop
+ ;; CHECK-BIN-NEXT: (block (result i32)
+ ;; CHECK-BIN-NEXT: (local.set $scratch_4
+ ;; CHECK-BIN-NEXT: (tuple.extract 2 0
+ ;; CHECK-BIN-NEXT: (local.tee $scratch_3
+ ;; CHECK-BIN-NEXT: (block $block (type $1) (result i32 i64)
;; CHECK-BIN-NEXT: (drop
- ;; CHECK-BIN-NEXT: (tuple.extract 3 2
- ;; CHECK-BIN-NEXT: (local.get $0)
+ ;; CHECK-BIN-NEXT: (block (result i32)
+ ;; CHECK-BIN-NEXT: (local.set $scratch_2
+ ;; CHECK-BIN-NEXT: (tuple.extract 3 0
+ ;; CHECK-BIN-NEXT: (local.tee $scratch
+ ;; CHECK-BIN-NEXT: (block $block1 (type $2) (result i32 i64 exnref)
+ ;; CHECK-BIN-NEXT: (block $block2
+ ;; CHECK-BIN-NEXT: (throw_ref
+ ;; CHECK-BIN-NEXT: (block $block3 (result exnref)
+ ;; CHECK-BIN-NEXT: (try_table (catch $e-i32-i64 $block) (catch_ref $e-i32-i64 $block1) (catch_all $block2) (catch_all_ref $block3)
+ ;; CHECK-BIN-NEXT: (call $foo)
+ ;; CHECK-BIN-NEXT: (call $foo)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (br $block4)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (br $block4)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (drop
+ ;; CHECK-BIN-NEXT: (block (result i64)
+ ;; CHECK-BIN-NEXT: (local.set $scratch_1
+ ;; CHECK-BIN-NEXT: (tuple.extract 3 1
+ ;; CHECK-BIN-NEXT: (local.get $scratch)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (drop
+ ;; CHECK-BIN-NEXT: (tuple.extract 3 2
+ ;; CHECK-BIN-NEXT: (local.get $scratch)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (local.get $scratch_1)
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (local.get $scratch_2)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (local.get $1)
+ ;; CHECK-BIN-NEXT: (br $block4)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (local.get $2)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (br $label$1)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (drop
- ;; CHECK-BIN-NEXT: (block (result i32)
- ;; CHECK-BIN-NEXT: (local.set $4
- ;; CHECK-BIN-NEXT: (tuple.extract 2 0
- ;; CHECK-BIN-NEXT: (local.get $3)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: (drop
;; CHECK-BIN-NEXT: (tuple.extract 2 1
- ;; CHECK-BIN-NEXT: (local.get $3)
+ ;; CHECK-BIN-NEXT: (local.get $scratch_3)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: (local.get $4)
+ ;; CHECK-BIN-NEXT: (local.get $scratch_4)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
@@ -625,10 +624,10 @@
;; CHECK-TEXT-NEXT: )
;; CHECK-TEXT-NEXT: )
;; CHECK-BIN: (func $try-table-with-label-and-br (type $4) (result i32)
- ;; CHECK-BIN-NEXT: (block $label$1 (result i32)
- ;; CHECK-BIN-NEXT: (block $label$2 (result i32)
- ;; CHECK-BIN-NEXT: (try_table (result i32) (catch $e-i32 $label$1)
- ;; CHECK-BIN-NEXT: (br $label$2
+ ;; CHECK-BIN-NEXT: (block $block (result i32)
+ ;; CHECK-BIN-NEXT: (block $block1 (result i32)
+ ;; CHECK-BIN-NEXT: (try_table (result i32) (catch $e-i32 $block)
+ ;; CHECK-BIN-NEXT: (br $block1
;; CHECK-BIN-NEXT: (i32.const 0)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
@@ -670,11 +669,11 @@
;; CHECK-TEXT-NEXT: )
;; CHECK-TEXT-NEXT: )
;; CHECK-BIN: (func $nested-try-table (type $3) (result exnref)
- ;; CHECK-BIN-NEXT: (block $label$1 (result exnref)
+ ;; CHECK-BIN-NEXT: (block $block (result exnref)
;; CHECK-BIN-NEXT: (drop
- ;; CHECK-BIN-NEXT: (block $label$2 (result i32)
- ;; CHECK-BIN-NEXT: (try_table (catch_all_ref $label$1)
- ;; CHECK-BIN-NEXT: (try_table (catch $e-i32 $label$2)
+ ;; CHECK-BIN-NEXT: (block $block1 (result i32)
+ ;; CHECK-BIN-NEXT: (try_table (catch_all_ref $block)
+ ;; CHECK-BIN-NEXT: (try_table (catch $e-i32 $block1)
;; CHECK-BIN-NEXT: (if
;; CHECK-BIN-NEXT: (i32.const 0)
;; CHECK-BIN-NEXT: (then
@@ -688,8 +687,11 @@
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (unreachable)
;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (unreachable)
;; CHECK-BIN-NEXT: )
+ ;; CHECK-BIN-NEXT: (unreachable)
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: )
;; CHECK-BIN-NEXT: (ref.null noexn)
@@ -779,238 +781,237 @@
;; CHECK-BIN-NODEBUG-NEXT: (try_table
;; CHECK-BIN-NODEBUG-NEXT: (throw $tag$4)
;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (unreachable)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG: (func $3 (type $4) (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$1 (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$0 $label$1)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block (result i32)
+;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$0 $block)
;; CHECK-BIN-NODEBUG-NEXT: (throw $tag$0
;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (unreachable)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG: (func $4 (type $0)
;; CHECK-BIN-NODEBUG-NEXT: (throw_ref
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$1 (result exnref)
-;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch_all_ref $label$1)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block (result exnref)
+;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch_all_ref $block)
;; CHECK-BIN-NODEBUG-NEXT: (throw $tag$1
;; CHECK-BIN-NODEBUG-NEXT: (i64.const 0)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (unreachable)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG: (func $5 (type $0)
-;; CHECK-BIN-NODEBUG-NEXT: (local $0 (tuple i32 i64))
-;; CHECK-BIN-NODEBUG-NEXT: (local $1 i32)
-;; CHECK-BIN-NODEBUG-NEXT: (local $2 (tuple i32 i64 exnref))
-;; CHECK-BIN-NODEBUG-NEXT: (local $3 i64)
-;; CHECK-BIN-NODEBUG-NEXT: (local $4 i32)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$1
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $2
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$2 (type $2) (result i32 i64 exnref)
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $0
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$3 (type $1) (result i32 i64)
-;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$2 $label$3) (catch_ref $tag$2 $label$2)
-;; CHECK-BIN-NODEBUG-NEXT: (throw $tag$2
-;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0)
-;; CHECK-BIN-NODEBUG-NEXT: (i64.const 0)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (drop
-;; CHECK-BIN-NODEBUG-NEXT: (block (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $1
-;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 2 0
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $0)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (drop
-;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 2 1
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $0)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $1)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$1)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch (tuple i32 i64))
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch_1 i32)
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch_2 (tuple i32 i64 exnref))
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch_3 i64)
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch_4 i32)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block2
;; CHECK-BIN-NODEBUG-NEXT: (drop
;; CHECK-BIN-NODEBUG-NEXT: (block (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $4
+;; CHECK-BIN-NODEBUG-NEXT: (local.set $scratch_4
;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 3 0
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $2)
+;; CHECK-BIN-NODEBUG-NEXT: (local.tee $scratch_2
+;; CHECK-BIN-NODEBUG-NEXT: (block $block1 (type $2) (result i32 i64 exnref)
+;; CHECK-BIN-NODEBUG-NEXT: (drop
+;; CHECK-BIN-NODEBUG-NEXT: (block (result i32)
+;; CHECK-BIN-NODEBUG-NEXT: (local.set $scratch_1
+;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 2 0
+;; CHECK-BIN-NODEBUG-NEXT: (local.tee $scratch
+;; CHECK-BIN-NODEBUG-NEXT: (block $block (type $1) (result i32 i64)
+;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$2 $block) (catch_ref $tag$2 $block1)
+;; CHECK-BIN-NODEBUG-NEXT: (throw $tag$2
+;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0)
+;; CHECK-BIN-NODEBUG-NEXT: (i64.const 0)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (unreachable)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (drop
+;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 2 1
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch_1)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (br $block2)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: (drop
;; CHECK-BIN-NODEBUG-NEXT: (block (result i64)
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $3
+;; CHECK-BIN-NODEBUG-NEXT: (local.set $scratch_3
;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 3 1
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $2)
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch_2)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: (drop
;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 3 2
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $2)
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch_2)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $3)
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch_3)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $4)
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch_4)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG: (func $6 (type $0)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$1
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$2
+;; CHECK-BIN-NODEBUG-NEXT: (block $block4
+;; CHECK-BIN-NODEBUG-NEXT: (block $block
;; CHECK-BIN-NODEBUG-NEXT: (drop
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$3 (result exnref)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$4
+;; CHECK-BIN-NODEBUG-NEXT: (block $block1 (result exnref)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block2
;; CHECK-BIN-NODEBUG-NEXT: (throw_ref
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$5 (result exnref)
-;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$4 $label$2) (catch_ref $tag$4 $label$3) (catch_all $label$4) (catch_all_ref $label$5)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block3 (result exnref)
+;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$4 $block) (catch_ref $tag$4 $block1) (catch_all $block2) (catch_all_ref $block3)
;; CHECK-BIN-NODEBUG-NEXT: (call $0)
;; CHECK-BIN-NODEBUG-NEXT: (call $0)
;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$1)
+;; CHECK-BIN-NODEBUG-NEXT: (br $block4)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$1)
+;; CHECK-BIN-NODEBUG-NEXT: (br $block4)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$1)
+;; CHECK-BIN-NODEBUG-NEXT: (br $block4)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG: (func $7 (type $0)
-;; CHECK-BIN-NODEBUG-NEXT: (local $0 (tuple i32 exnref))
-;; CHECK-BIN-NODEBUG-NEXT: (local $1 i32)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$1
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch (tuple i32 exnref))
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch_1 i32)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block4
;; CHECK-BIN-NODEBUG-NEXT: (drop
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$2 (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $0
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$3 (type $5) (result i32 exnref)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$4
-;; CHECK-BIN-NODEBUG-NEXT: (throw_ref
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$5 (result exnref)
-;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$0 $label$2) (catch_ref $tag$0 $label$3) (catch_all $label$4) (catch_all_ref $label$5)
-;; CHECK-BIN-NODEBUG-NEXT: (call $0)
-;; CHECK-BIN-NODEBUG-NEXT: (call $0)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$1)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$1)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (block $block (result i32)
;; CHECK-BIN-NODEBUG-NEXT: (drop
;; CHECK-BIN-NODEBUG-NEXT: (block (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $1
+;; CHECK-BIN-NODEBUG-NEXT: (local.set $scratch_1
;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 2 0
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $0)
+;; CHECK-BIN-NODEBUG-NEXT: (local.tee $scratch
+;; CHECK-BIN-NODEBUG-NEXT: (block $block1 (type $5) (result i32 exnref)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block2
+;; CHECK-BIN-NODEBUG-NEXT: (throw_ref
+;; CHECK-BIN-NODEBUG-NEXT: (block $block3 (result exnref)
+;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$0 $block) (catch_ref $tag$0 $block1) (catch_all $block2) (catch_all_ref $block3)
+;; CHECK-BIN-NODEBUG-NEXT: (call $0)
+;; CHECK-BIN-NODEBUG-NEXT: (call $0)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (br $block4)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (br $block4)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: (drop
;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 2 1
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $0)
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $1)
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch_1)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$1)
+;; CHECK-BIN-NODEBUG-NEXT: (br $block4)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG: (func $8 (type $0)
-;; CHECK-BIN-NODEBUG-NEXT: (local $0 (tuple i32 i64 exnref))
-;; CHECK-BIN-NODEBUG-NEXT: (local $1 i64)
-;; CHECK-BIN-NODEBUG-NEXT: (local $2 i32)
-;; CHECK-BIN-NODEBUG-NEXT: (local $3 (tuple i32 i64))
-;; CHECK-BIN-NODEBUG-NEXT: (local $4 i32)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$1
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $3
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$2 (type $1) (result i32 i64)
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $0
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$3 (type $2) (result i32 i64 exnref)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$4
-;; CHECK-BIN-NODEBUG-NEXT: (throw_ref
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$5 (result exnref)
-;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$2 $label$2) (catch_ref $tag$2 $label$3) (catch_all $label$4) (catch_all_ref $label$5)
-;; CHECK-BIN-NODEBUG-NEXT: (call $0)
-;; CHECK-BIN-NODEBUG-NEXT: (call $0)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$1)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$1)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (drop
-;; CHECK-BIN-NODEBUG-NEXT: (block (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $2
-;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 3 0
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $0)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (drop
-;; CHECK-BIN-NODEBUG-NEXT: (block (result i64)
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $1
-;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 3 1
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $0)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch (tuple i32 i64 exnref))
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch_1 i64)
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch_2 i32)
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch_3 (tuple i32 i64))
+;; CHECK-BIN-NODEBUG-NEXT: (local $scratch_4 i32)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block4
+;; CHECK-BIN-NODEBUG-NEXT: (drop
+;; CHECK-BIN-NODEBUG-NEXT: (block (result i32)
+;; CHECK-BIN-NODEBUG-NEXT: (local.set $scratch_4
+;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 2 0
+;; CHECK-BIN-NODEBUG-NEXT: (local.tee $scratch_3
+;; CHECK-BIN-NODEBUG-NEXT: (block $block (type $1) (result i32 i64)
;; CHECK-BIN-NODEBUG-NEXT: (drop
-;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 3 2
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $0)
+;; CHECK-BIN-NODEBUG-NEXT: (block (result i32)
+;; CHECK-BIN-NODEBUG-NEXT: (local.set $scratch_2
+;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 3 0
+;; CHECK-BIN-NODEBUG-NEXT: (local.tee $scratch
+;; CHECK-BIN-NODEBUG-NEXT: (block $block1 (type $2) (result i32 i64 exnref)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block2
+;; CHECK-BIN-NODEBUG-NEXT: (throw_ref
+;; CHECK-BIN-NODEBUG-NEXT: (block $block3 (result exnref)
+;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$2 $block) (catch_ref $tag$2 $block1) (catch_all $block2) (catch_all_ref $block3)
+;; CHECK-BIN-NODEBUG-NEXT: (call $0)
+;; CHECK-BIN-NODEBUG-NEXT: (call $0)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (br $block4)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (br $block4)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (drop
+;; CHECK-BIN-NODEBUG-NEXT: (block (result i64)
+;; CHECK-BIN-NODEBUG-NEXT: (local.set $scratch_1
+;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 3 1
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (drop
+;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 3 2
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch_1)
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch_2)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $1)
+;; CHECK-BIN-NODEBUG-NEXT: (br $block4)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $2)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$1)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (drop
-;; CHECK-BIN-NODEBUG-NEXT: (block (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (local.set $4
-;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 2 0
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $3)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: (drop
;; CHECK-BIN-NODEBUG-NEXT: (tuple.extract 2 1
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $3)
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch_3)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: (local.get $4)
+;; CHECK-BIN-NODEBUG-NEXT: (local.get $scratch_4)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG: (func $9 (type $4) (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$1 (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$2 (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (try_table (result i32) (catch $tag$0 $label$1)
-;; CHECK-BIN-NODEBUG-NEXT: (br $label$2
+;; CHECK-BIN-NODEBUG-NEXT: (block $block (result i32)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block1 (result i32)
+;; CHECK-BIN-NODEBUG-NEXT: (try_table (result i32) (catch $tag$0 $block)
+;; CHECK-BIN-NODEBUG-NEXT: (br $block1
;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
@@ -1019,11 +1020,11 @@
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG: (func $10 (type $3) (result exnref)
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$1 (result exnref)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block (result exnref)
;; CHECK-BIN-NODEBUG-NEXT: (drop
-;; CHECK-BIN-NODEBUG-NEXT: (block $label$2 (result i32)
-;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch_all_ref $label$1)
-;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$0 $label$2)
+;; CHECK-BIN-NODEBUG-NEXT: (block $block1 (result i32)
+;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch_all_ref $block)
+;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$0 $block1)
;; CHECK-BIN-NODEBUG-NEXT: (if
;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0)
;; CHECK-BIN-NODEBUG-NEXT: (then
@@ -1037,8 +1038,11 @@
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (unreachable)
;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (unreachable)
;; CHECK-BIN-NODEBUG-NEXT: )
+;; CHECK-BIN-NODEBUG-NEXT: (unreachable)
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: )
;; CHECK-BIN-NODEBUG-NEXT: (ref.null noexn)