summaryrefslogtreecommitdiff
path: root/test/lit/passes/optimize-casts.wast
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2022-12-07 16:06:53 -0600
committerGitHub <noreply@github.com>2022-12-07 14:06:53 -0800
commitc79548b93a81ccf7609413da1345a7570c51b9ba (patch)
tree7783fbf6610383fb76fe312fe3c125860428b779 /test/lit/passes/optimize-casts.wast
parent5a8d09bfe725f321b022187e294991db3ffaa417 (diff)
downloadbinaryen-c79548b93a81ccf7609413da1345a7570c51b9ba.tar.gz
binaryen-c79548b93a81ccf7609413da1345a7570c51b9ba.tar.bz2
binaryen-c79548b93a81ccf7609413da1345a7570c51b9ba.zip
Add standard versions of WasmGC casts (#5331)
We previously supported only the non-standard cast instructions introduced when we were experimenting with nominal types. Parse the names and opcodes of their standard counterparts and switch to emitting the standard names and opcodes. Port all of the tests to use the standard instructions, but add additional tests showing that the non-standard versions are still parsed correctly.
Diffstat (limited to 'test/lit/passes/optimize-casts.wast')
-rw-r--r--test/lit/passes/optimize-casts.wast40
1 files changed, 20 insertions, 20 deletions
diff --git a/test/lit/passes/optimize-casts.wast b/test/lit/passes/optimize-casts.wast
index c75efd48f..3d18e281f 100644
--- a/test/lit/passes/optimize-casts.wast
+++ b/test/lit/passes/optimize-casts.wast
@@ -96,7 +96,7 @@
;; CHECK-NEXT: (local $1 (ref $A))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $1
- ;; CHECK-NEXT: (ref.cast_static $A
+ ;; CHECK-NEXT: (ref.cast null $A
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -112,7 +112,7 @@
;; As $ref.as but with ref.casts: we should use the cast value after it has
;; been computed, in both gets.
(drop
- (ref.cast_static $A
+ (ref.cast null $A
(local.get $x)
)
)
@@ -128,7 +128,7 @@
;; CHECK-NEXT: (local $1 (ref $A))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $1
- ;; CHECK-NEXT: (ref.cast_static $A
+ ;; CHECK-NEXT: (ref.cast null $A
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -145,7 +145,7 @@
;; CHECK-NEXT: )
(func $not-past-set (param $x (ref struct))
(drop
- (ref.cast_static $A
+ (ref.cast null $A
(local.get $x)
)
)
@@ -166,7 +166,7 @@
;; CHECK-NEXT: (local $2 (ref $B))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $1
- ;; CHECK-NEXT: (ref.cast_static $A
+ ;; CHECK-NEXT: (ref.cast null $A
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -176,7 +176,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $2
- ;; CHECK-NEXT: (ref.cast_static $B
+ ;; CHECK-NEXT: (ref.cast null $B
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -187,7 +187,7 @@
;; CHECK-NEXT: )
(func $best (param $x (ref struct))
(drop
- (ref.cast_static $A
+ (ref.cast null $A
(local.get $x)
)
)
@@ -196,7 +196,7 @@
(local.get $x)
)
(drop
- (ref.cast_static $B
+ (ref.cast null $B
(local.get $x)
)
)
@@ -210,7 +210,7 @@
;; CHECK-NEXT: (local $1 (ref $B))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $1
- ;; CHECK-NEXT: (ref.cast_static $B
+ ;; CHECK-NEXT: (ref.cast null $B
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -219,7 +219,7 @@
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (ref.cast_static $A
+ ;; CHECK-NEXT: (ref.cast null $A
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -231,7 +231,7 @@
;; As above, but with the casts reversed. Now we should use $B in both
;; gets.
(drop
- (ref.cast_static $B
+ (ref.cast null $B
(local.get $x)
)
)
@@ -239,7 +239,7 @@
(local.get $x)
)
(drop
- (ref.cast_static $A
+ (ref.cast null $A
(local.get $x)
)
)
@@ -252,7 +252,7 @@
;; CHECK-NEXT: (local $1 (ref $A))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $1
- ;; CHECK-NEXT: (ref.cast_static $A
+ ;; CHECK-NEXT: (ref.cast null $A
;; CHECK-NEXT: (block (result (ref data))
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
@@ -265,7 +265,7 @@
;; CHECK-NEXT: )
(func $fallthrough (param $x (ref struct))
(drop
- (ref.cast_static $A
+ (ref.cast null $A
;; We look through the block, and optimize.
(block (result (ref struct))
(local.get $x)
@@ -279,7 +279,7 @@
;; CHECK: (func $past-basic-block (type $ref|data|_=>_none) (param $x (ref data))
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (ref.cast_static $A
+ ;; CHECK-NEXT: (ref.cast null $A
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -293,7 +293,7 @@
;; CHECK-NEXT: )
(func $past-basic-block (param $x (ref struct))
(drop
- (ref.cast_static $A
+ (ref.cast null $A
(local.get $x)
)
)
@@ -321,14 +321,14 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $4
- ;; CHECK-NEXT: (ref.cast_static $A
+ ;; CHECK-NEXT: (ref.cast null $A
;; CHECK-NEXT: (local.get $a)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $5
- ;; CHECK-NEXT: (ref.cast_static $A
+ ;; CHECK-NEXT: (ref.cast null $A
;; CHECK-NEXT: (local.get $b)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -360,12 +360,12 @@
(local.get $y)
)
(drop
- (ref.cast_static $A
+ (ref.cast null $A
(local.get $a)
)
)
(drop
- (ref.cast_static $A
+ (ref.cast null $A
(local.get $b)
)
)