summaryrefslogtreecommitdiff
path: root/test/lit/validation
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/validation')
-rw-r--r--test/lit/validation/bad-non-nullable-locals.wast61
-rw-r--r--test/lit/validation/nn-tuples.wast17
2 files changed, 69 insertions, 9 deletions
diff --git a/test/lit/validation/bad-non-nullable-locals.wast b/test/lit/validation/bad-non-nullable-locals.wast
new file mode 100644
index 000000000..f22771591
--- /dev/null
+++ b/test/lit/validation/bad-non-nullable-locals.wast
@@ -0,0 +1,61 @@
+;; RUN: foreach %s %t not wasm-opt -all 2>&1 | filecheck %s
+
+;; CHECK: non-nullable local's sets must dominate gets
+(module
+ (func $inner-to-func
+ ;; a set in an inner scope does *not* help a get validate.
+ (local $x (ref func))
+ (block $b
+ (local.set $x
+ (ref.func $helper)
+ )
+ )
+ (drop
+ (local.get $x)
+ )
+ )
+
+ (func $helper)
+)
+
+;; CHECK: non-nullable local's sets must dominate gets
+(module
+ (func $get-without-set
+ (local $x (ref func))
+ (drop
+ (local.get $x)
+ )
+ )
+
+ (func $helper)
+)
+
+;; CHECK: non-nullable local's sets must dominate gets
+(module
+ (func $get-before-set
+ (local $x (ref func))
+ (local.set $x
+ (local.get $x)
+ )
+ )
+
+ (func $helper)
+)
+
+;; CHECK: non-nullable local's sets must dominate gets
+(module
+ (func $if-arms
+ (local $x (ref func))
+ (if
+ (i32.const 1)
+ ;; Superficially the order is right, but not really.
+ (local.set $x
+ (ref.func $helper)
+ )
+ (local.get $x)
+ )
+ )
+
+ (func $helper)
+)
+
diff --git a/test/lit/validation/nn-tuples.wast b/test/lit/validation/nn-tuples.wast
index 452a6c77e..5ecf55fbd 100644
--- a/test/lit/validation/nn-tuples.wast
+++ b/test/lit/validation/nn-tuples.wast
@@ -1,16 +1,15 @@
-;; 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
+;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
-;; NO-NN-LOCALS: vars must be defaultable
+;; RUN: wasm-opt %s -all -S -o - \
+;; RUN: | filecheck %s
-;; NN-LOCALS: (module
-;; NN-LOCALS: (local $tuple ((ref any) (ref any)))
-;; NN-LOCALS: (nop)
-;; NN-LOCALS: )
+;; Test for non-nullable types in tuples
(module
+ ;; CHECK: (func $foo
+ ;; CHECK-NEXT: (local $tuple ((ref any) (ref any)))
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
(func $foo
(local $tuple ((ref any) (ref any)))
)