summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt2
-rw-r--r--test/example/c-api-kitchen-sink.txt2
-rw-r--r--test/lit/passes/ssa-gc-nn-locals.wast27
3 files changed, 29 insertions, 2 deletions
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 600795c05..b8b671de5 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -42,7 +42,7 @@ Features.Multivalue: 512
Features.GC: 1024
Features.Memory64: 2048
Features.TypedFunctionReferences: 4096
-Features.All: 8191
+Features.All: 16383
InvalidId: 0
BlockId: 1
IfId: 2
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index fd1b5e64c..eb83ffb33 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -26,7 +26,7 @@ BinaryenFeatureMultivalue: 512
BinaryenFeatureGC: 1024
BinaryenFeatureMemory64: 2048
BinaryenFeatureTypedFunctionReferences: 4096
-BinaryenFeatureAll: 8191
+BinaryenFeatureAll: 16383
(f32.neg
(f32.const -33.61199951171875)
)
diff --git a/test/lit/passes/ssa-gc-nn-locals.wast b/test/lit/passes/ssa-gc-nn-locals.wast
new file mode 100644
index 000000000..149a0c5c7
--- /dev/null
+++ b/test/lit/passes/ssa-gc-nn-locals.wast
@@ -0,0 +1,27 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
+;; RUN: wasm-opt %s -all --ssa --enable-gc-nn-locals -S -o - | filecheck %s
+
+(module
+ ;; CHECK: (func $nn-locals
+ ;; CHECK-NEXT: (local $x (ref func))
+ ;; CHECK-NEXT: (local.set $x
+ ;; CHECK-NEXT: (ref.func $nn-locals)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $nn-locals
+ ;; A non-nullable local
+ (local $x (ref func))
+ ;; Set the local, and get it later. The SSA pass will normally handle non-
+ ;; nullability using ref.as_non_null, but with --gc-nn-locals nothing should
+ ;; be done.
+ (local.set $x (ref.func $nn-locals))
+ (drop (local.get $x))
+ (drop (local.get $x))
+ )
+)