summaryrefslogtreecommitdiff
path: root/test/lit/validation
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-03-03 14:10:02 -0800
committerGitHub <noreply@github.com>2023-03-03 22:10:02 +0000
commitc891c01ca5813172775ae859126a0ec3857ad8b7 (patch)
tree396b4b1bd9bc66e155d96111c6a42f0217ffb212 /test/lit/validation
parentdea234b50fac389605209e818bbab39777984f36 (diff)
downloadbinaryen-c891c01ca5813172775ae859126a0ec3857ad8b7.tar.gz
binaryen-c891c01ca5813172775ae859126a0ec3857ad8b7.tar.bz2
binaryen-c891c01ca5813172775ae859126a0ec3857ad8b7.zip
Note function signature param/result features for validation (#5542)
As with #5535, this was not noticed because it can only happen on very small modules where the param/result type appears nowhere else but in a function signature. Use generic heap type scanning, which also scans into struct and array types etc.
Diffstat (limited to 'test/lit/validation')
-rw-r--r--test/lit/validation/ref-func-simd.wast13
-rw-r--r--test/lit/validation/ref-gc-simd.wast13
2 files changed, 26 insertions, 0 deletions
diff --git a/test/lit/validation/ref-func-simd.wast b/test/lit/validation/ref-func-simd.wast
new file mode 100644
index 000000000..78f2ed99e
--- /dev/null
+++ b/test/lit/validation/ref-func-simd.wast
@@ -0,0 +1,13 @@
+;; A function type that uses a SIMD type requires the SIMD feature.
+;; RUN: not wasm-opt --enable-reference-types %s 2>&1 | filecheck %s
+
+;; CHECK: all used types should be allowed
+
+(module
+ (type $simd-user (func (param v128)))
+
+ (global $g (ref null $simd-user) (ref.null func))
+)
+
+;; But it passes with the feature enabled.
+;; RUN: wasm-opt --enable-reference-types --enable-simd %s
diff --git a/test/lit/validation/ref-gc-simd.wast b/test/lit/validation/ref-gc-simd.wast
new file mode 100644
index 000000000..991144f6c
--- /dev/null
+++ b/test/lit/validation/ref-gc-simd.wast
@@ -0,0 +1,13 @@
+;; A gc type that uses a SIMD type requires the SIMD feature.
+;; RUN: not wasm-opt --enable-reference-types --enable-gc %s 2>&1 | filecheck %s
+
+;; CHECK: all used types should be allowed
+
+(module
+ (type $simd-user (struct (field v128)))
+
+ (global $g (ref null $simd-user) (ref.null $simd-user))
+)
+
+;; But it passes with the feature enabled.
+;; RUN: wasm-opt --enable-reference-types --enable-gc --enable-simd %s