summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-05-11 11:23:55 -0700
committerGitHub <noreply@github.com>2022-05-11 11:23:55 -0700
commit57bef0d2f9a38a2add940e07fc422fd532574013 (patch)
tree0e93c4aaa08985d631ea87bfbee452825d93c405 /test
parentbad3f9e8f058cfdaefb3d7d76a93e842665f8435 (diff)
downloadbinaryen-57bef0d2f9a38a2add940e07fc422fd532574013.tar.gz
binaryen-57bef0d2f9a38a2add940e07fc422fd532574013.tar.bz2
binaryen-57bef0d2f9a38a2add940e07fc422fd532574013.zip
Add ref.cast_nop_static (#4656)
This unsafe experimental instruction is semantically equivalent to ref.cast_static, but V8 will unsafely turn it into a nop. This is meant to help us measure cast overhead more precisely than we can by globally turning all casts into nops.
Diffstat (limited to 'test')
-rw-r--r--test/lit/ref-cast-nop.wast18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lit/ref-cast-nop.wast b/test/lit/ref-cast-nop.wast
new file mode 100644
index 000000000..6e49508d5
--- /dev/null
+++ b/test/lit/ref-cast-nop.wast
@@ -0,0 +1,18 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
+
+;; RUN: wasm-opt -all %s -S --roundtrip -o - | filecheck %s
+
+(module
+ ;; CHECK: (type $struct (struct (field i32)))
+ (type $struct (struct i32))
+ ;; CHECK: (func $ref.cast_nop_static (param $x (ref any)) (result (ref $struct))
+ ;; CHECK-NEXT: (ref.cast_nop_static $struct
+ ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $ref.cast_nop_static (param $x (ref any)) (result (ref $struct))
+ (ref.cast_nop_static $struct
+ (local.get $x)
+ )
+ )
+)