summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-08-26 09:51:12 -0700
committerGitHub <noreply@github.com>2022-08-26 16:51:12 +0000
commitde2120298d260c5ffe5165428359028d76d14b86 (patch)
tree2d0867065884b4b86ad1c93bec8c8d193cfeec39 /test
parent47b29f9ab6caff2070860a60e656ec99239f7521 (diff)
downloadbinaryen-de2120298d260c5ffe5165428359028d76d14b86.tar.gz
binaryen-de2120298d260c5ffe5165428359028d76d14b86.tar.bz2
binaryen-de2120298d260c5ffe5165428359028d76d14b86.zip
Add support for Tag names in the Names section (#4970)
Diffstat (limited to 'test')
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt2
-rw-r--r--test/exception-handling.wast.fromBinary68
-rw-r--r--test/lit/passes/stack-ir-roundtrip-eh.wast5
-rw-r--r--test/reference-types.wast.fromBinary10
-rw-r--r--test/tags.wast.fromBinary16
5 files changed, 51 insertions, 50 deletions
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index de3510545..f92ceeb4a 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -4797,7 +4797,7 @@ module loaded from binary form:
(type $i32_i32_=>_none (func (param i32 i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(global $a-global i32 (i32.const 3))
- (tag $tag$0 (param i32 i32))
+ (tag $a-tag (param i32 i32))
(func $adder (param $0 i32) (param $1 i32) (result i32)
(i32.add
(local.get $0)
diff --git a/test/exception-handling.wast.fromBinary b/test/exception-handling.wast.fromBinary
index 74e8f4d4a..73a4ae975 100644
--- a/test/exception-handling.wast.fromBinary
+++ b/test/exception-handling.wast.fromBinary
@@ -4,11 +4,11 @@
(type $i64_=>_none (func (param i64)))
(type $i32_i64_=>_none (func (param i32 i64)))
(type $eqref_=>_none (func (param eqref)))
- (tag $tag$0 (param i32))
- (tag $tag$1 (param i64))
- (tag $tag$2 (param i32 i64))
- (tag $tag$3 (param eqref))
- (tag $tag$4 (param))
+ (tag $e-i32 (param i32))
+ (tag $e-i64 (param i64))
+ (tag $e-i32-i64 (param i32 i64))
+ (tag $e-eqref (param eqref))
+ (tag $e-empty (param))
(func $foo
(nop)
)
@@ -23,11 +23,11 @@
(local $4 i32)
(try $label$3
(do
- (throw $tag$0
+ (throw $e-i32
(i32.const 0)
)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -35,12 +35,12 @@
)
(try $label$6
(do
- (throw $tag$2
+ (throw $e-i32-i64
(i32.const 0)
(i64.const 0)
)
)
- (catch $tag$2
+ (catch $e-i32-i64
(local.set $2
(pop i32 i64)
)
@@ -77,7 +77,7 @@
(do
(br $label$7)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -89,7 +89,7 @@
(do
(nop)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -100,7 +100,7 @@
(call $foo)
(call $bar)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -110,16 +110,16 @@
)
(try $label$19
(do
- (throw $tag$0
+ (throw $e-i32
(i32.const 0)
)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
)
- (catch $tag$1
+ (catch $e-i64
(drop
(pop i64)
)
@@ -127,7 +127,7 @@
)
(try $label$22
(do
- (throw $tag$0
+ (throw $e-i32
(i32.const 0)
)
)
@@ -137,16 +137,16 @@
)
(try $label$25
(do
- (throw $tag$0
+ (throw $e-i32
(i32.const 0)
)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
)
- (catch $tag$1
+ (catch $e-i64
(drop
(pop i64)
)
@@ -160,11 +160,11 @@
(do
(try $label$29
(do
- (throw $tag$0
+ (throw $e-i32
(i32.const 0)
)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -174,7 +174,7 @@
)
)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -182,11 +182,11 @@
(catch_all
(try $label$33
(do
- (throw $tag$0
+ (throw $e-i32
(i32.const 0)
)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -199,7 +199,7 @@
)
(try $label$37
(do
- (throw $tag$0
+ (throw $e-i32
(i32.const 0)
)
)
@@ -271,7 +271,7 @@
(do
(nop)
)
- (catch $tag$4
+ (catch $e-empty
(nop)
)
)
@@ -281,7 +281,7 @@
(do
(call $foo)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -296,7 +296,7 @@
(do
(call $foo)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -316,7 +316,7 @@
(do
(call $foo)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -337,7 +337,7 @@
(do
(call $foo)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -387,8 +387,8 @@
(do
(nop)
)
- (catch $tag$0
- (throw $tag$0
+ (catch $e-i32
+ (throw $e-i32
(if (result i32)
(pop i32)
(i32.const 0)
@@ -401,7 +401,7 @@
(do
(nop)
)
- (catch $tag$3
+ (catch $e-eqref
(drop
(pop eqref)
)
@@ -414,7 +414,7 @@
(block $label$1
(try $label$4
(do
- (throw $tag$0
+ (throw $e-i32
(i32.const 0)
)
)
diff --git a/test/lit/passes/stack-ir-roundtrip-eh.wast b/test/lit/passes/stack-ir-roundtrip-eh.wast
index df68d3f8a..790462cb9 100644
--- a/test/lit/passes/stack-ir-roundtrip-eh.wast
+++ b/test/lit/passes/stack-ir-roundtrip-eh.wast
@@ -2,6 +2,7 @@
;; RUN: wasm-opt %s --generate-stack-ir --roundtrip -all -S -o - | filecheck %s
(module
+ ;; CHECK: (tag $tag (param i32))
(tag $tag (param i32))
;; CHECK: (func $delegate-child
;; CHECK-NEXT: (try $label$9
@@ -10,7 +11,7 @@
;; CHECK-NEXT: (do
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (catch $tag$0
+ ;; CHECK-NEXT: (catch $tag
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (pop i32)
;; CHECK-NEXT: )
@@ -23,7 +24,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (catch $tag$0
+ ;; CHECK-NEXT: (catch $tag
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (pop i32)
;; CHECK-NEXT: )
diff --git a/test/reference-types.wast.fromBinary b/test/reference-types.wast.fromBinary
index 01523cab8..80d85fd26 100644
--- a/test/reference-types.wast.fromBinary
+++ b/test/reference-types.wast.fromBinary
@@ -18,7 +18,7 @@
(table $0 3 3 funcref)
(elem (i32.const 0) $take_eqref $take_funcref $take_anyref)
(elem declare func $foo $ref-taken-but-not-in-table)
- (tag $tag$0 (param i32))
+ (tag $e-i32 (param i32))
(export "export_func" (func $import_func))
(export "export_global" (global $import_global))
(func $take_eqref (param $0 eqref)
@@ -416,7 +416,7 @@
(do
(local.get $local_eqref)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -429,7 +429,7 @@
(do
(ref.func $foo)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -442,7 +442,7 @@
(do
(local.get $local_eqref)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
@@ -455,7 +455,7 @@
(do
(ref.null eq)
)
- (catch $tag$0
+ (catch $e-i32
(drop
(pop i32)
)
diff --git a/test/tags.wast.fromBinary b/test/tags.wast.fromBinary
index 81043d682..5528068c0 100644
--- a/test/tags.wast.fromBinary
+++ b/test/tags.wast.fromBinary
@@ -2,15 +2,15 @@
(type $i32_f32_=>_none (func (param i32 f32)))
(type $i32_=>_none (func (param i32)))
(type $none_=>_none (func))
- (import "env" "im0" (tag $eimport$0 (param i32)))
+ (import "env" "im0" (tag $e-import (param i32)))
(import "env" "im1" (tag $eimport$1 (param i32 f32)))
(tag $tag$0 (param i32))
- (tag $tag$1 (param i32 f32))
- (tag $tag$2 (param))
- (tag $tag$3 (param i32 f32))
- (tag $tag$4 (param i32 f32))
- (tag $tag$5 (param i32))
- (export "ex0" (tag $tag$5))
- (export "ex1" (tag $tag$1))
+ (tag $e (param i32 f32))
+ (tag $empty (param))
+ (tag $e-params0 (param i32 f32))
+ (tag $e-params1 (param i32 f32))
+ (tag $e-export (param i32))
+ (export "ex0" (tag $e-export))
+ (export "ex1" (tag $e))
)