diff options
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 2 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 3 | ||||
-rw-r--r-- | test/example/type-builder-nominal.txt | 100 | ||||
-rw-r--r-- | test/example/type-builder.txt | 68 | ||||
-rw-r--r-- | test/example/typeinfo.txt | 40 |
5 files changed, 105 insertions, 108 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 8dd9260d5..d20c76100 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -2090,8 +2090,6 @@ void test_func_opt() { void test_typesystem() { BinaryenTypeSystem defaultTypeSystem = BinaryenGetTypeSystem(); assert(defaultTypeSystem == BinaryenTypeSystemIsorecursive()); - printf("BinaryenTypeSystemEquirecursive: %d\n", - BinaryenTypeSystemEquirecursive()); BinaryenSetTypeSystem(BinaryenTypeSystemNominal()); assert(BinaryenGetTypeSystem() == BinaryenTypeSystemNominal()); printf("BinaryenTypeSystemNominal: %d\n", BinaryenTypeSystemNominal()); diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 857988419..c4dd09168 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -3028,9 +3028,8 @@ optimized: (i32.const 4) ) ) -BinaryenTypeSystemEquirecursive: 0 BinaryenTypeSystemNominal: 1 -BinaryenTypeSystemIsorecursive: 2 +BinaryenTypeSystemIsorecursive: 0 TypeBuilderErrorReasonSelfSupertype: 0 TypeBuilderErrorReasonInvalidSupertype: 1 TypeBuilderErrorReasonForwardSupertypeReference: 2 diff --git a/test/example/type-builder-nominal.txt b/test/example/type-builder-nominal.txt index 8d146cc1f..b542f212c 100644 --- a/test/example/type-builder-nominal.txt +++ b/test/example/type-builder-nominal.txt @@ -1,24 +1,24 @@ ;; Test TypeBuilder Before setting heap types: -$sig => (; temp ;) (func_subtype func) -$struct => (; temp ;) (func_subtype func) -$array => (; temp ;) (func_subtype func) +$sig => (; temp ;) (func) +$struct => (; temp ;) (func) +$array => (; temp ;) (func) (ref $sig) => (; temp ;) (ref $0) (ref $struct) => (; temp ;) (ref $1) (ref $array) => (; temp ;) (ref $2) (ref null $array) => (; temp ;) (ref null $2) After setting heap types: -$sig => (; temp ;) (func_subtype (param (; temp ;) (ref $1)) (result (; temp ;) (ref $2) i32) func) -$struct => (; temp ;) (struct_subtype (field (; temp ;) (ref null $2)) data) -$array => (; temp ;) (array_subtype (mut anyref) data) +$sig => (; temp ;) (func (param (; temp ;) (ref $1)) (result (; temp ;) (ref $2) i32)) +$struct => (; temp ;) (struct (field (; temp ;) (ref null $2))) +$array => (; temp ;) (array (mut anyref)) (ref $sig) => (; temp ;) (ref $0) (ref $struct) => (; temp ;) (ref $1) (ref $array) => (; temp ;) (ref $2) (ref null $array) => (; temp ;) (ref null $2) After building types: -$sig => (func_subtype (param (ref $1)) (result (ref $2) i32) func) -$struct => (struct_subtype (field (ref null $2)) data) -$array => (array_subtype (mut anyref) data) +$sig => (func (param (ref $1)) (result (ref $2) i32)) +$struct => (struct (field (ref null $2))) +$array => (array (mut anyref)) (ref $sig) => (ref $0) (ref $struct) => (ref $1) (ref $array) => (ref $2) @@ -27,49 +27,49 @@ $array => (array_subtype (mut anyref) data) ;; Test basic ;; Test canonical signatures ;; Test recursive types -(func_subtype (result (ref null $0)) func) +(func (result (ref null $0))) -(func_subtype (result (ref null $1)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $1))) +(func (result (ref null $0))) -(func_subtype (result (ref null $1)) func) -(func_subtype (result (ref null $2)) func) -(func_subtype (result (ref null $3)) func) -(func_subtype (result (ref null $4)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $1))) +(func (result (ref null $2))) +(func (result (ref null $3))) +(func (result (ref null $4))) +(func (result (ref null $0))) -(func_subtype (result (ref null $0) (ref null $2)) func) -(func_subtype (result (ref null $1) (ref null $3)) func) -(func_subtype func) -(func_subtype func) -(func_subtype (result (ref null $0)) func) -(func_subtype (result (ref null $1)) func) +(func (result (ref null $0) (ref null $2))) +(func (result (ref null $1) (ref null $3))) +(func) +(func) +(func (result (ref null $0))) +(func (result (ref null $1))) -(func_subtype (result (ref null $0)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $0))) +(func (result (ref null $0))) ;; Test subtyping ;; Test TypeBuilder Before setting heap types: -$sig => (; temp ;) (func_subtype func) -$struct => (; temp ;) (func_subtype func) -$array => (; temp ;) (func_subtype func) +$sig => (; temp ;) (func) +$struct => (; temp ;) (func) +$array => (; temp ;) (func) (ref $sig) => (; temp ;) (ref $0) (ref $struct) => (; temp ;) (ref $1) (ref $array) => (; temp ;) (ref $2) (ref null $array) => (; temp ;) (ref null $2) After setting heap types: -$sig => (; temp ;) (func_subtype (param (; temp ;) (ref $1)) (result (; temp ;) (ref $2) i32) func) -$struct => (; temp ;) (struct_subtype (field (; temp ;) (ref null $2)) data) -$array => (; temp ;) (array_subtype (mut anyref) data) +$sig => (; temp ;) (func (param (; temp ;) (ref $1)) (result (; temp ;) (ref $2) i32)) +$struct => (; temp ;) (struct (field (; temp ;) (ref null $2))) +$array => (; temp ;) (array (mut anyref)) (ref $sig) => (; temp ;) (ref $0) (ref $struct) => (; temp ;) (ref $1) (ref $array) => (; temp ;) (ref $2) (ref null $array) => (; temp ;) (ref null $2) After building types: -$sig => (func_subtype (param (ref $1)) (result (ref $2) i32) func) -$struct => (struct_subtype (field (ref null $2)) data) -$array => (array_subtype (mut anyref) data) +$sig => (func (param (ref $1)) (result (ref $2) i32)) +$struct => (struct (field (ref null $2))) +$array => (array (mut anyref)) (ref $sig) => (ref $0) (ref $struct) => (ref $1) (ref $array) => (ref $2) @@ -78,25 +78,25 @@ $array => (array_subtype (mut anyref) data) ;; Test basic ;; Test canonical signatures ;; Test recursive types -(func_subtype (result (ref null $0)) func) +(func (result (ref null $0))) -(func_subtype (result (ref null $1)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $1))) +(func (result (ref null $0))) -(func_subtype (result (ref null $1)) func) -(func_subtype (result (ref null $2)) func) -(func_subtype (result (ref null $3)) func) -(func_subtype (result (ref null $4)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $1))) +(func (result (ref null $2))) +(func (result (ref null $3))) +(func (result (ref null $4))) +(func (result (ref null $0))) -(func_subtype (result (ref null $0) (ref null $2)) func) -(func_subtype (result (ref null $1) (ref null $3)) func) -(func_subtype func) -(func_subtype func) -(func_subtype (result (ref null $0)) func) -(func_subtype (result (ref null $1)) func) +(func (result (ref null $0) (ref null $2))) +(func (result (ref null $1) (ref null $3))) +(func) +(func) +(func (result (ref null $0))) +(func (result (ref null $1))) -(func_subtype (result (ref null $0)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $0))) +(func (result (ref null $0))) ;; Test subtyping diff --git a/test/example/type-builder.txt b/test/example/type-builder.txt index af40fd5de..6d584e7be 100644 --- a/test/example/type-builder.txt +++ b/test/example/type-builder.txt @@ -1,54 +1,54 @@ ;; Test canonicalization ;; Test basic ;; Test recursive types -(func_subtype (result (ref null $0)) func) +(func (result (ref null $0))) -(func_subtype (result (ref null $1)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $1))) +(func (result (ref null $0))) -(func_subtype (result (ref null $1)) func) -(func_subtype (result (ref null $2)) func) -(func_subtype (result (ref null $3)) func) -(func_subtype (result (ref null $4)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $1))) +(func (result (ref null $2))) +(func (result (ref null $3))) +(func (result (ref null $4))) +(func (result (ref null $0))) -(func_subtype func) -(func_subtype func) -(func_subtype (result (ref null $0) (ref null $2)) func) -(func_subtype (result (ref null $0) (ref null $3)) func) -(func_subtype (result (ref null $2)) func) -(func_subtype (result (ref null $3)) func) +(func) +(func) +(func (result (ref null $0) (ref null $2))) +(func (result (ref null $0) (ref null $3))) +(func (result (ref null $2))) +(func (result (ref null $3))) -(func_subtype (result (ref null $0)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $0))) +(func (result (ref null $0))) any -(func_subtype (param anyref) (result (ref null $1)) func) +(func (param anyref) (result (ref null $1))) ;; Test canonicalization ;; Test basic ;; Test recursive types -(func_subtype (result (ref null $0)) func) +(func (result (ref null $0))) -(func_subtype (result (ref null $1)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $1))) +(func (result (ref null $0))) -(func_subtype (result (ref null $1)) func) -(func_subtype (result (ref null $2)) func) -(func_subtype (result (ref null $3)) func) -(func_subtype (result (ref null $4)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $1))) +(func (result (ref null $2))) +(func (result (ref null $3))) +(func (result (ref null $4))) +(func (result (ref null $0))) -(func_subtype func) -(func_subtype func) -(func_subtype (result (ref null $0) (ref null $2)) func) -(func_subtype (result (ref null $0) (ref null $3)) func) -(func_subtype (result (ref null $2)) func) -(func_subtype (result (ref null $3)) func) +(func) +(func) +(func (result (ref null $0) (ref null $2))) +(func (result (ref null $0) (ref null $3))) +(func (result (ref null $2))) +(func (result (ref null $3))) -(func_subtype (result (ref null $0)) func) -(func_subtype (result (ref null $0)) func) +(func (result (ref null $0))) +(func (result (ref null $0))) any -(func_subtype (param anyref) (result (ref null $1)) func) +(func (param anyref) (result (ref null $1))) diff --git a/test/example/typeinfo.txt b/test/example/typeinfo.txt index 67f9766d0..7015e6cfc 100644 --- a/test/example/typeinfo.txt +++ b/test/example/typeinfo.txt @@ -11,31 +11,31 @@ eqref i31 i31ref (ref i31) -(func_subtype func) -(struct_subtype data) -(array_subtype i32 data) +(func) +(struct) +(array i32) ;; Signature -(func_subtype func) +(func) (ref $func.0) (ref null $func.0) -(func_subtype (param i32) (result f64) func) +(func (param i32) (result f64)) (ref $func.0) (ref null $func.0) ;; Struct -(struct_subtype data) +(struct) (ref $struct.0) (ref null $struct.0) -(struct_subtype (field i32 i64 (mut f32) (mut f64)) data) +(struct (field i32 i64 (mut f32) (mut f64))) (ref $struct.0) (ref null $struct.0) ;; Array -(array_subtype i32 data) +(array i32) (ref $array.0) (ref null $array.0) -(array_subtype (mut i64) data) +(array (mut i64)) (ref $array.0) (ref null $array.0) @@ -46,33 +46,33 @@ none (i32 f64) ;; Signature of references (param/result) -(func_subtype (param (ref null $struct.0)) (result (ref $array.0)) func) +(func (param (ref null $struct.0)) (result (ref $array.0))) ;; Signature of references (params/results) -(func_subtype (param (ref null $struct.0) (ref $array.0)) (result (ref $struct.0) (ref null $array.1)) func) +(func (param (ref null $struct.0) (ref $array.0)) (result (ref $struct.0) (ref null $array.1))) ;; Struct of references -(struct_subtype (field (ref $func.0) (mut (ref $func.0)) (ref null $func.0) (mut (ref null $func.0))) data) +(struct (field (ref $func.0) (mut (ref $func.0)) (ref null $func.0) (mut (ref null $func.0)))) (ref $struct.0) (ref null $struct.0) -(struct_subtype (field (ref $struct.0) (mut (ref $struct.0)) (ref null $struct.0) (mut (ref null $struct.0))) data) +(struct (field (ref $struct.0) (mut (ref $struct.0)) (ref null $struct.0) (mut (ref null $struct.0)))) (ref $struct.0) (ref null $struct.0) -(struct_subtype (field (ref $array.0) (mut (ref $array.0)) (ref null $array.0) (mut (ref null $array.0))) data) +(struct (field (ref $array.0) (mut (ref $array.0)) (ref null $array.0) (mut (ref null $array.0)))) (ref $struct.0) (ref null $struct.0) -(struct_subtype (field (mut i32) (mut (ref null $func.0)) (mut (ref null $struct.0)) (mut (ref null $array.0))) data) +(struct (field (mut i32) (mut (ref null $func.0)) (mut (ref null $struct.0)) (mut (ref null $array.0)))) (ref $struct.0) (ref null $struct.0) ;; Array of references -(array_subtype (ref null $func.0) data) +(array (ref null $func.0)) (ref $array.0) (ref null $array.0) -(array_subtype (mut (ref null $struct.0)) data) +(array (mut (ref null $struct.0))) (ref $array.0) (ref null $array.0) -(array_subtype (ref null $array.0) data) +(array (ref null $array.0)) (ref $array.0) (ref null $array.0) @@ -81,7 +81,7 @@ none ((ref $func.0) (ref null $func.0) (ref $struct.0) (ref null $struct.0) (ref $array.0) (ref null $array.0)) ;; Recursive (not really) -(func_subtype (param (ref $func.0)) func) +(func (param (ref $func.0))) (ref $func.0) -(func_subtype (param (ref $array.0)) func) +(func (param (ref $array.0))) (ref $func.0) |