1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
;; TODO: Autogenerate these checks! The current script cannot handle `rec`.
;; RUN: wasm-opt %s -all --hybrid -S -o - | filecheck %s --check-prefix HYBRID
;; RUN: wasm-opt %s -all --hybrid --roundtrip -S -o - | filecheck %s --check-prefix HYBRID
;; RUN: wasm-opt %s -all --nominal -S -o - | filecheck %s --check-prefix NOMINAL
(module
;; HYBRID: (rec
;; HYBRID-NEXT: (type $super-struct (struct_subtype (field i32) data))
;; HYBRID-NEXT: (type $sub-struct (struct_subtype (field i32) (field i64) $super-struct))
;; HYBRID-NEXT: )
;; HYBRID: (rec
;; HYBRID-NEXT: (type $super-array (array_subtype (ref $super-struct) data))
;; HYBRID-NEXT: (type $sub-array (array_subtype (ref $sub-struct) $super-array))
;; HYBRID-NEXT: )
;; NOMINAL-NOT: rec
;; NOMINAL: (type $super-struct (struct_subtype (field i32) data))
;; NOMINAL-NEXT: (type $sub-struct (struct_subtype (field i32) (field i64) $super-struct))
;; NOMINAL: (type $super-array (array_subtype (ref $super-struct) data))
;; NOMINAL-NEXT: (type $sub-array (array_subtype (ref $sub-struct) $super-array))
(rec
(type $super-struct (struct i32))
(type $sub-struct (struct_subtype i32 i64 $super-struct))
)
(rec
(type $super-array (array (ref $super-struct)))
(type $sub-array (array_subtype (ref $sub-struct) $super-array))
)
(func $make-super-struct (result (ref $super-struct))
(call $make-sub-struct)
)
(func $make-sub-struct (result (ref $sub-struct))
(unreachable)
)
(func $make-super-array (result (ref $super-array))
(call $make-sub-array)
)
(func $make-sub-array (result (ref $sub-array))
(unreachable)
)
)
|