summaryrefslogtreecommitdiff
path: root/test/lit/passes/cfp.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/cfp.wast')
-rw-r--r--test/lit/passes/cfp.wast188
1 files changed, 94 insertions, 94 deletions
diff --git a/test/lit/passes/cfp.wast b/test/lit/passes/cfp.wast
index db6e108bf..99fd9d209 100644
--- a/test/lit/passes/cfp.wast
+++ b/test/lit/passes/cfp.wast
@@ -4,9 +4,9 @@
;; name getting in the way)
(module
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $struct (struct (field i32)))
+ ;; CHECK: (type $struct (struct_subtype (field i32) data))
(type $struct (struct i32))
;; CHECK: (func $impossible-get
;; CHECK-NEXT: (drop
@@ -31,9 +31,9 @@
)
(module
- ;; CHECK: (type $struct (struct (field i64)))
+ ;; CHECK: (type $struct (struct_subtype (field i64) data))
(type $struct (struct i64))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $test
;; CHECK-NEXT: (drop
@@ -74,9 +74,9 @@
)
(module
- ;; CHECK: (type $struct (struct (field f32)))
+ ;; CHECK: (type $struct (struct_subtype (field f32) data))
(type $struct (struct f32))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $test
;; CHECK-NEXT: (drop
@@ -114,9 +114,9 @@
)
(module
- ;; CHECK: (type $struct (struct (field f32)))
+ ;; CHECK: (type $struct (struct_subtype (field f32) data))
(type $struct (struct f32))
- ;; CHECK: (type $f32_=>_none (func (param f32)))
+ ;; CHECK: (type $f32_=>_none (func_subtype (param f32) func))
;; CHECK: (func $test (param $f f32)
;; CHECK-NEXT: (drop
@@ -150,9 +150,9 @@
;; Create in one function, get in another. The 10 should be forwarded to the
;; get.
(module
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $struct (struct (field i32)))
+ ;; CHECK: (type $struct (struct_subtype (field i32) data))
(type $struct (struct i32))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -194,9 +194,9 @@
;; As before, but with the order of functions reversed to check for any ordering
;; issues.
(module
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $struct (struct (field i32)))
+ ;; CHECK: (type $struct (struct_subtype (field i32) data))
(type $struct (struct i32))
;; CHECK: (func $get
@@ -240,9 +240,9 @@
;; Different values assigned in the same function, in different struct.news,
;; so we cannot optimize the struct.get away.
(module
- ;; CHECK: (type $struct (struct (field f32)))
+ ;; CHECK: (type $struct (struct_subtype (field f32) data))
(type $struct (struct f32))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $test
;; CHECK-NEXT: (drop
@@ -286,9 +286,9 @@
;; Different values assigned in different functions, and one is a struct.set.
(module
- ;; CHECK: (type $struct (struct (field (mut f32))))
+ ;; CHECK: (type $struct (struct_subtype (field (mut f32)) data))
(type $struct (struct (mut f32)))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -337,9 +337,9 @@
;; As the last testcase, but the values happen to coincide, so we can optimize
;; the get into a constant.
(module
- ;; CHECK: (type $struct (struct (field (mut f32))))
+ ;; CHECK: (type $struct (struct_subtype (field (mut f32)) data))
(type $struct (struct (mut f32)))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -392,11 +392,11 @@
;; Check that we look into the fallthrough value that is assigned.
(module
- ;; CHECK: (type $struct (struct (field (mut f32))))
+ ;; CHECK: (type $struct (struct_subtype (field (mut f32)) data))
(type $struct (struct (mut f32)))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $i32_=>_none (func (param i32)))
+ ;; CHECK: (type $i32_=>_none (func_subtype (param i32) func))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -465,9 +465,9 @@
;; Test a function reference instead of a number.
(module
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $struct (struct (field funcref)))
+ ;; CHECK: (type $struct (struct_subtype (field funcref) data))
(type $struct (struct funcref))
;; CHECK: (elem declare func $test)
@@ -507,7 +507,7 @@
;; Test for unreachable creations, sets, and gets.
(module
(type $struct (struct (mut i32)))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $test
;; CHECK-NEXT: (drop
@@ -555,12 +555,12 @@
;; subtype, the get must trap anyhow (the reference it receives can
;; only be null in this closed world).
(module
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $struct (struct (field i32)))
+ ;; CHECK: (type $struct (struct_subtype (field i32) data))
(type $struct (struct i32))
- ;; CHECK: (type $substruct (struct (field i32)) (extends $struct))
- (type $substruct (struct i32) (extends $struct))
+ ;; CHECK: (type $substruct (struct_subtype (field i32) $struct))
+ (type $substruct (struct_subtype i32 $struct))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -602,12 +602,12 @@
;; will optimize the result to the only possible value. (In practice, though,
;; it will trap anyhow.)
(module
- ;; CHECK: (type $struct (struct (field (mut i32))))
+ ;; CHECK: (type $struct (struct_subtype (field (mut i32)) data))
(type $struct (struct (mut i32)))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $substruct (struct (field (mut i32))) (extends $struct))
- (type $substruct (struct (mut i32)) (extends $struct))
+ ;; CHECK: (type $substruct (struct_subtype (field (mut i32)) $struct))
+ (type $substruct (struct_subtype (mut i32) $struct))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -658,12 +658,12 @@
;; reference to the subtype (we never create a supertype) and so we
;; can optimize.
(module
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $substruct (struct (field i32) (field f64)) (extends $struct))
- (type $substruct (struct i32 f64) (extends $struct))
+ ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ (type $substruct (struct_subtype i32 f64 $struct))
- ;; CHECK: (type $struct (struct (field i32)))
+ ;; CHECK: (type $struct (struct_subtype (field i32) data))
(type $struct (struct i32))
;; CHECK: (func $create
@@ -708,12 +708,12 @@
;; Subtyping: Create both a subtype and a supertype, with identical constants
;; for the shared field, and get the supertype.
(module
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $struct (struct (field i32)))
+ ;; CHECK: (type $struct (struct_subtype (field i32) data))
(type $struct (struct i32))
- ;; CHECK: (type $substruct (struct (field i32) (field f64)) (extends $struct))
- (type $substruct (struct i32 f64) (extends $struct))
+ ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ (type $substruct (struct_subtype i32 f64 $struct))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -770,12 +770,12 @@
;; for the shared field, preventing optimization, as a get of the
;; supertype may receive an instance of the subtype.
(module
- ;; CHECK: (type $struct (struct (field i32)))
+ ;; CHECK: (type $struct (struct_subtype (field i32) data))
(type $struct (struct i32))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $substruct (struct (field i32) (field f64)) (extends $struct))
- (type $substruct (struct i32 f64) (extends $struct))
+ ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ (type $substruct (struct_subtype i32 f64 $struct))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -828,12 +828,12 @@
;; shared between the types, but we only create the substruct with
;; one value, so we can optimize.
(module
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $substruct (struct (field i32) (field f64)) (extends $struct))
- (type $substruct (struct i32 f64) (extends $struct))
+ ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ (type $substruct (struct_subtype i32 f64 $struct))
- ;; CHECK: (type $struct (struct (field i32)))
+ ;; CHECK: (type $struct (struct_subtype (field i32) data))
(type $struct (struct i32))
;; CHECK: (func $create
@@ -889,13 +889,13 @@
;; As above, but add a set of $struct. The set prevents the optimization.
(module
- ;; CHECK: (type $struct (struct (field (mut i32))))
+ ;; CHECK: (type $struct (struct_subtype (field (mut i32)) data))
(type $struct (struct (mut i32)))
- ;; CHECK: (type $substruct (struct (field (mut i32)) (field f64)) (extends $struct))
- (type $substruct (struct (mut i32) f64) (extends $struct))
+ ;; CHECK: (type $substruct (struct_subtype (field (mut i32)) (field f64) $struct))
+ (type $substruct (struct_subtype (mut i32) f64 $struct))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -954,15 +954,15 @@
;; Multi-level subtyping, check that we propagate not just to the immediate
;; supertype but all the way as needed.
(module
- ;; CHECK: (type $struct3 (struct (field i32) (field f64) (field anyref)) (extends $struct2))
- (type $struct3 (struct i32 f64 anyref) (extends $struct2))
+ ;; CHECK: (type $struct3 (struct_subtype (field i32) (field f64) (field anyref) $struct2))
+ (type $struct3 (struct_subtype i32 f64 anyref $struct2))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $struct2 (struct (field i32) (field f64)) (extends $struct1))
- (type $struct2 (struct i32 f64) (extends $struct1))
+ ;; CHECK: (type $struct2 (struct_subtype (field i32) (field f64) $struct1))
+ (type $struct2 (struct_subtype i32 f64 $struct1))
- ;; CHECK: (type $struct1 (struct (field i32)))
+ ;; CHECK: (type $struct1 (struct_subtype (field i32) data))
(type $struct1 (struct i32))
;; CHECK: (func $create
@@ -1089,18 +1089,18 @@
;; different values in the sub-most type. Create the top and bottom types, but
;; not the middle one.
(module
- ;; CHECK: (type $struct3 (struct (field i32) (field i32) (field f64) (field f64) (field anyref) (field anyref)) (extends $struct2))
- (type $struct3 (struct i32 i32 f64 f64 anyref anyref) (extends $struct2))
+ ;; CHECK: (type $struct3 (struct_subtype (field i32) (field i32) (field f64) (field f64) (field anyref) (field anyref) $struct2))
+ (type $struct3 (struct_subtype i32 i32 f64 f64 anyref anyref $struct2))
- ;; CHECK: (type $struct1 (struct (field i32) (field i32)))
+ ;; CHECK: (type $struct1 (struct_subtype (field i32) (field i32) data))
(type $struct1 (struct i32 i32))
- ;; CHECK: (type $struct2 (struct (field i32) (field i32) (field f64) (field f64)) (extends $struct1))
- (type $struct2 (struct i32 i32 f64 f64) (extends $struct1))
+ ;; CHECK: (type $struct2 (struct_subtype (field i32) (field i32) (field f64) (field f64) $struct1))
+ (type $struct2 (struct_subtype i32 i32 f64 f64 $struct1))
- ;; CHECK: (type $anyref_=>_none (func (param anyref)))
+ ;; CHECK: (type $anyref_=>_none (func_subtype (param anyref) func))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $create (param $any anyref)
;; CHECK-NEXT: (drop
@@ -1323,14 +1323,14 @@
;; Multi-level subtyping with a different value in the middle of the chain. We
;; can only optimize $struct3.
(module
- ;; CHECK: (type $struct1 (struct (field (mut i32))))
+ ;; CHECK: (type $struct1 (struct_subtype (field (mut i32)) data))
(type $struct1 (struct (mut i32)))
- ;; CHECK: (type $struct2 (struct (field (mut i32)) (field f64)) (extends $struct1))
- (type $struct2 (struct (mut i32) f64) (extends $struct1))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $struct2 (struct_subtype (field (mut i32)) (field f64) $struct1))
+ (type $struct2 (struct_subtype (mut i32) f64 $struct1))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $struct3 (struct (field (mut i32)) (field f64) (field anyref)) (extends $struct2))
- (type $struct3 (struct (mut i32) f64 anyref) (extends $struct2))
+ ;; CHECK: (type $struct3 (struct_subtype (field (mut i32)) (field f64) (field anyref) $struct2))
+ (type $struct3 (struct_subtype (mut i32) f64 anyref $struct2))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -1423,16 +1423,16 @@
;; As above, but add not just a new of the middle class with a different value
;; but also a set. That prevents all optimizations.
(module
- ;; CHECK: (type $struct2 (struct (field (mut i32)) (field f64)) (extends $struct1))
- (type $struct2 (struct (mut i32) f64) (extends $struct1))
+ ;; CHECK: (type $struct2 (struct_subtype (field (mut i32)) (field f64) $struct1))
+ (type $struct2 (struct_subtype (mut i32) f64 $struct1))
- ;; CHECK: (type $struct1 (struct (field (mut i32))))
+ ;; CHECK: (type $struct1 (struct_subtype (field (mut i32)) data))
(type $struct1 (struct (mut i32)))
- ;; CHECK: (type $struct3 (struct (field (mut i32)) (field f64) (field anyref)) (extends $struct2))
- (type $struct3 (struct (mut i32) f64 anyref) (extends $struct2))
+ ;; CHECK: (type $struct3 (struct_subtype (field (mut i32)) (field f64) (field anyref) $struct2))
+ (type $struct3 (struct_subtype (mut i32) f64 anyref $struct2))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -1529,10 +1529,10 @@
;; Test for a struct with multiple fields, some of which are constant and hence
;; optimizable, and some not. Also test that some have the same type.
(module
- ;; CHECK: (type $struct (struct (field i32) (field f64) (field i32) (field f64) (field i32)))
+ ;; CHECK: (type $struct (struct_subtype (field i32) (field f64) (field i32) (field f64) (field i32) data))
(type $struct (struct i32 f64 i32 f64 i32))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -1653,20 +1653,20 @@
;; sets, and the final subtype C has a create and a get. The set to A should
;; apply to it, preventing optimization.
(module
- ;; CHECK: (type $C (struct (field (mut i32))) (extends $B))
- (type $C (struct (mut i32)) (extends $B))
+ ;; CHECK: (type $C (struct_subtype (field (mut i32)) $B))
+ (type $C (struct_subtype (mut i32) $B))
- ;; CHECK: (type $A (struct (field (mut i32))))
+ ;; CHECK: (type $A (struct_subtype (field (mut i32)) data))
(type $A (struct (mut i32)))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $ref|$A|_=>_none (func (param (ref $A))))
+ ;; CHECK: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func))
- ;; CHECK: (type $ref|$C|_=>_none (func (param (ref $C))))
+ ;; CHECK: (type $ref|$C|_=>_none (func_subtype (param (ref $C)) func))
- ;; CHECK: (type $B (struct (field (mut i32))) (extends $A))
- (type $B (struct (mut i32)) (extends $A))
+ ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ (type $B (struct_subtype (mut i32) $A))
;; CHECK: (func $create
;; CHECK-NEXT: (drop
@@ -1715,10 +1715,10 @@
;; Copies of a field to itself can be ignored. As a result, we can optimize both
;; of the gets here.
(module
- ;; CHECK: (type $struct (struct (field (mut i32))))
+ ;; CHECK: (type $struct (struct_subtype (field (mut i32)) data))
(type $struct (struct (mut i32)))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $test
;; CHECK-NEXT: (drop
@@ -1773,11 +1773,11 @@
;; Test of a near-copy, of a similar looking field (same index, and same field
;; type) but in a different struct.
(module
- ;; CHECK: (type $struct (struct (field (mut f32)) (field (mut i32))))
+ ;; CHECK: (type $struct (struct_subtype (field (mut f32)) (field (mut i32)) data))
(type $struct (struct (mut f32) (mut i32)))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
- ;; CHECK: (type $other (struct (field (mut f64)) (field (mut i32))))
+ ;; CHECK: (type $other (struct_subtype (field (mut f64)) (field (mut i32)) data))
(type $other (struct (mut f64) (mut i32)))
;; CHECK: (func $test
@@ -1824,10 +1824,10 @@
;; Test of a near-copy, of a different index.
(module
- ;; CHECK: (type $struct (struct (field (mut i32)) (field (mut i32))))
+ ;; CHECK: (type $struct (struct_subtype (field (mut i32)) (field (mut i32)) data))
(type $struct (struct (mut i32) (mut i32)))
- ;; CHECK: (type $none_=>_none (func))
+ ;; CHECK: (type $none_=>_none (func_subtype func))
;; CHECK: (func $test
;; CHECK-NEXT: (drop