summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-01-29 02:47:52 +0000
committerGitHub <noreply@github.com>2021-01-28 18:47:52 -0800
commitbbf40d06a162be8f88a60d1fc4edc3f0015c6c91 (patch)
treee1919618535c320632ed05dbc770bcc516a2e013 /test
parent6299471584ce74d365526e33ed0a662bd2ee3490 (diff)
downloadbinaryen-bbf40d06a162be8f88a60d1fc4edc3f0015c6c91.tar.gz
binaryen-bbf40d06a162be8f88a60d1fc4edc3f0015c6c91.tar.bz2
binaryen-bbf40d06a162be8f88a60d1fc4edc3f0015c6c91.zip
[GC] ref.as_non_null (#3527)
This is different than the other RefAs variants in that it is part of the typed functions proposal, and not GC. But it is part of GC prototype 3. Note: This is not useful to us yet as we don't support non-nullable types.
Diffstat (limited to 'test')
-rw-r--r--test/heap-types.wast1
-rw-r--r--test/heap-types.wast.from-wast5
-rw-r--r--test/heap-types.wast.fromBinary5
-rw-r--r--test/heap-types.wast.fromBinary.noDebugInfo5
4 files changed, 16 insertions, 0 deletions
diff --git a/test/heap-types.wast b/test/heap-types.wast
index 94138276a..e06d1dff6 100644
--- a/test/heap-types.wast
+++ b/test/heap-types.wast
@@ -188,6 +188,7 @@
(if (ref.is_i31 (local.get $x)) (unreachable))
)
(func $ref.as_X (param $x anyref)
+ (drop (ref.as_non_null (local.get $x)))
(drop (ref.as_func (local.get $x)))
(drop (ref.as_data (local.get $x)))
(drop (ref.as_i31 (local.get $x)))
diff --git a/test/heap-types.wast.from-wast b/test/heap-types.wast.from-wast
index a737a50ab..f3e8d5ce6 100644
--- a/test/heap-types.wast.from-wast
+++ b/test/heap-types.wast.from-wast
@@ -221,6 +221,11 @@
)
(func $ref.as_X (param $x anyref)
(drop
+ (ref.as_non_null
+ (local.get $x)
+ )
+ )
+ (drop
(ref.as_func
(local.get $x)
)
diff --git a/test/heap-types.wast.fromBinary b/test/heap-types.wast.fromBinary
index b1256ac4f..80c91d2fe 100644
--- a/test/heap-types.wast.fromBinary
+++ b/test/heap-types.wast.fromBinary
@@ -220,6 +220,11 @@
)
(func $ref.as_X (param $x anyref)
(drop
+ (ref.as_non_null
+ (local.get $x)
+ )
+ )
+ (drop
(ref.as_func
(local.get $x)
)
diff --git a/test/heap-types.wast.fromBinary.noDebugInfo b/test/heap-types.wast.fromBinary.noDebugInfo
index 5febb58a3..2852b8bea 100644
--- a/test/heap-types.wast.fromBinary.noDebugInfo
+++ b/test/heap-types.wast.fromBinary.noDebugInfo
@@ -220,6 +220,11 @@
)
(func $6 (param $0 anyref)
(drop
+ (ref.as_non_null
+ (local.get $0)
+ )
+ )
+ (drop
(ref.as_func
(local.get $0)
)