summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/signature-refining.wast38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/lit/passes/signature-refining.wast b/test/lit/passes/signature-refining.wast
index 11bc84f35..996adf658 100644
--- a/test/lit/passes/signature-refining.wast
+++ b/test/lit/passes/signature-refining.wast
@@ -850,3 +850,41 @@
)
)
)
+
+(module
+ ;; CHECK: (rec
+ ;; CHECK-NEXT: (type $ref|$[i8]|_=>_none (func (param (ref $[i8]))))
+
+ ;; CHECK: (type $[i8] (array i8))
+ (type $[i8] (array i8))
+
+ ;; CHECK: (type $none_=>_none (func))
+
+ ;; CHECK: (func $0 (type $none_=>_none)
+ ;; CHECK-NEXT: (call $1
+ ;; CHECK-NEXT: (array.new_fixed $[i8])
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $0
+ (call $1
+ (array.new_fixed $[i8])
+ )
+ )
+
+ ;; CHECK: (func $1 (type $ref|$[i8]|_=>_none) (param $2 (ref $[i8]))
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (ref.cast struct
+ ;; CHECK-NEXT: (local.get $2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $1 (param $2 anyref)
+ ;; The param will become non-nullable after we refine. We must refinalize
+ ;; after doing so, so the cast becomes non-nullable as well.
+ (drop
+ (ref.cast null struct
+ (local.get $2)
+ )
+ )
+ )
+) ;; TODO