summaryrefslogtreecommitdiff
path: root/test/lit/isorecursive-good.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/isorecursive-good.wast')
-rw-r--r--test/lit/isorecursive-good.wast38
1 files changed, 34 insertions, 4 deletions
diff --git a/test/lit/isorecursive-good.wast b/test/lit/isorecursive-good.wast
index 350aabcf9..c7c9569eb 100644
--- a/test/lit/isorecursive-good.wast
+++ b/test/lit/isorecursive-good.wast
@@ -5,11 +5,13 @@
;; RUN: wasm-opt %s -all --nominal -S -o - | filecheck %s --check-prefix NOMINAL
(module
-
-
(rec
;; HYBRID: (rec
;; HYBRID-NEXT: (type $super-struct (struct (field i32)))
+ ;; NOMINAL: (type $super-array (array (ref $super-struct)))
+
+ ;; NOMINAL: (type $sub-array (array_subtype (ref $sub-struct) $super-array))
+
;; NOMINAL: (type $super-struct (struct (field i32)))
(type $super-struct (struct i32))
;; HYBRID: (type $sub-struct (struct_subtype (field i32) (field i64) $super-struct))
@@ -20,13 +22,21 @@
(rec
;; HYBRID: (rec
;; HYBRID-NEXT: (type $super-array (array (ref $super-struct)))
- ;; NOMINAL: (type $super-array (array (ref $super-struct)))
(type $super-array (array (ref $super-struct)))
;; HYBRID: (type $sub-array (array_subtype (ref $sub-struct) $super-array))
- ;; NOMINAL: (type $sub-array (array_subtype (ref $sub-struct) $super-array))
(type $sub-array (array_subtype (ref $sub-struct) $super-array))
)
+ (rec
+ ;; HYBRID: (rec
+ ;; HYBRID-NEXT: (type $super-func (func (param (ref $sub-array)) (result (ref $super-array))))
+ ;; NOMINAL: (type $super-func (func (param (ref $sub-array)) (result (ref $super-array))))
+ (type $super-func (func (param (ref $sub-array)) (result (ref $super-array))))
+ ;; HYBRID: (type $sub-func (func_subtype (param (ref $super-array)) (result (ref $sub-array)) $super-func))
+ ;; NOMINAL: (type $sub-func (func_subtype (param (ref $super-array)) (result (ref $sub-array)) $super-func))
+ (type $sub-func (func_subtype (param (ref $super-array)) (result (ref $sub-array)) $super-func))
+ )
+
;; HYBRID: (func $make-super-struct (type $none_=>_ref|$super-struct|) (result (ref $super-struct))
;; HYBRID-NEXT: (call $make-sub-struct)
;; HYBRID-NEXT: )
@@ -66,4 +76,24 @@
(func $make-sub-array (result (ref $sub-array))
(unreachable)
)
+
+ ;; HYBRID: (func $make-super-func (type $none_=>_ref|$super-func|) (result (ref $super-func))
+ ;; HYBRID-NEXT: (call $make-sub-func)
+ ;; HYBRID-NEXT: )
+ ;; NOMINAL: (func $make-super-func (type $none_=>_ref|$super-func|) (result (ref $super-func))
+ ;; NOMINAL-NEXT: (call $make-sub-func)
+ ;; NOMINAL-NEXT: )
+ (func $make-super-func (result (ref $super-func))
+ (call $make-sub-func)
+ )
+
+ ;; HYBRID: (func $make-sub-func (type $none_=>_ref|$sub-func|) (result (ref $sub-func))
+ ;; HYBRID-NEXT: (unreachable)
+ ;; HYBRID-NEXT: )
+ ;; NOMINAL: (func $make-sub-func (type $none_=>_ref|$sub-func|) (result (ref $sub-func))
+ ;; NOMINAL-NEXT: (unreachable)
+ ;; NOMINAL-NEXT: )
+ (func $make-sub-func (result (ref $sub-func))
+ (unreachable)
+ )
)