summaryrefslogtreecommitdiff
path: root/test/lit/passes/optimize-casts.wast
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2022-12-07 12:41:49 -0600
committerGitHub <noreply@github.com>2022-12-07 18:41:49 +0000
commit2590620a32190f98b29c7d9726865aa8082b4023 (patch)
tree22bb9475aecafe5aeae4977fe1b0edb49053f2e7 /test/lit/passes/optimize-casts.wast
parent3253df552729e771a31decf0e29a775f888b1e6f (diff)
downloadbinaryen-2590620a32190f98b29c7d9726865aa8082b4023.tar.gz
binaryen-2590620a32190f98b29c7d9726865aa8082b4023.tar.bz2
binaryen-2590620a32190f98b29c7d9726865aa8082b4023.zip
Update tests ahead of transition from `data` to `struct` (#5320)
The upstream WasmGC spec has removed `data` and introduced `struct`. To make the migration easier, we have been supporting `struct` as an `alias` for `data` and `structref` as an alias for `dataref`. Update the tests to prefer the `struct` aliases over `data` for test input to make the future migration easier. Also update some tests that had stale comments about ref.null types being updated and remove some tests for instructions like br_on_data and ref.as_data that do not make sense without a `data` type.
Diffstat (limited to 'test/lit/passes/optimize-casts.wast')
-rw-r--r--test/lit/passes/optimize-casts.wast22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/lit/passes/optimize-casts.wast b/test/lit/passes/optimize-casts.wast
index 285060dac..c75efd48f 100644
--- a/test/lit/passes/optimize-casts.wast
+++ b/test/lit/passes/optimize-casts.wast
@@ -108,7 +108,7 @@
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- (func $ref.cast (param $x (ref data))
+ (func $ref.cast (param $x (ref struct))
;; As $ref.as but with ref.casts: we should use the cast value after it has
;; been computed, in both gets.
(drop
@@ -143,7 +143,7 @@
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- (func $not-past-set (param $x (ref data))
+ (func $not-past-set (param $x (ref struct))
(drop
(ref.cast_static $A
(local.get $x)
@@ -185,7 +185,7 @@
;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- (func $best (param $x (ref data))
+ (func $best (param $x (ref struct))
(drop
(ref.cast_static $A
(local.get $x)
@@ -227,7 +227,7 @@
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- (func $best-2 (param $x (ref data))
+ (func $best-2 (param $x (ref struct))
;; As above, but with the casts reversed. Now we should use $B in both
;; gets.
(drop
@@ -263,11 +263,11 @@
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- (func $fallthrough (param $x (ref data))
+ (func $fallthrough (param $x (ref struct))
(drop
(ref.cast_static $A
;; We look through the block, and optimize.
- (block (result (ref data))
+ (block (result (ref struct))
(local.get $x)
)
)
@@ -291,7 +291,7 @@
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- (func $past-basic-block (param $x (ref data))
+ (func $past-basic-block (param $x (ref struct))
(drop
(ref.cast_static $A
(local.get $x)
@@ -349,9 +349,9 @@
;; CHECK-NEXT: (local.get $b)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- (func $multiple (param $x (ref data)) (param $y (ref data))
- (local $a (ref data))
- (local $b (ref data))
+ (func $multiple (param $x (ref struct)) (param $y (ref struct))
+ (local $a (ref struct))
+ (local $b (ref struct))
;; Two different locals, with overlapping lives.
(local.set $a
(local.get $x)
@@ -391,7 +391,7 @@
;; CHECK: (func $get (type $none_=>_ref|data|) (result (ref data))
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
- (func $get (result (ref data))
+ (func $get (result (ref struct))
;; Helper for the above.
(unreachable)
)