summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-03-30 15:54:44 -0700
committerGitHub <noreply@github.com>2022-03-30 15:54:44 -0700
commite7c4f9da6d4a98f58b6320b5769f653a6bf26d3e (patch)
tree917176abd4f7913cb831ca0567d597ea817c377e /test
parent247f4c20a1eea63ebe77c64e1681081b5b5de302 (diff)
downloadbinaryen-e7c4f9da6d4a98f58b6320b5769f653a6bf26d3e.tar.gz
binaryen-e7c4f9da6d4a98f58b6320b5769f653a6bf26d3e.tar.bz2
binaryen-e7c4f9da6d4a98f58b6320b5769f653a6bf26d3e.zip
[Wasm GC] Fix non-nullable tuples (#4555)
Apply the same logic to tuple fields as we do for all other fields, when checking whether a non-nullable value is valid. Fixes #4554
Diffstat (limited to 'test')
-rw-r--r--test/lit/validation/nn-tuples.wast17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/lit/validation/nn-tuples.wast b/test/lit/validation/nn-tuples.wast
new file mode 100644
index 000000000..452a6c77e
--- /dev/null
+++ b/test/lit/validation/nn-tuples.wast
@@ -0,0 +1,17 @@
+;; Test for non-nullable types in tuples
+
+;; RUN: not wasm-opt -all %s 2>&1 | filecheck %s --check-prefix NO-NN-LOCALS
+;; RUN: wasm-opt -all %s --enable-gc-nn-locals -o - -S | filecheck %s --check-prefix NN-LOCALS
+
+;; NO-NN-LOCALS: vars must be defaultable
+
+;; NN-LOCALS: (module
+;; NN-LOCALS: (local $tuple ((ref any) (ref any)))
+;; NN-LOCALS: (nop)
+;; NN-LOCALS: )
+
+(module
+ (func $foo
+ (local $tuple ((ref any) (ref any)))
+ )
+)