diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 37 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 3 | ||||
-rw-r--r-- | test/example/type-builder.cpp | 233 | ||||
-rw-r--r-- | test/example/type-builder.txt | 54 | ||||
-rw-r--r-- | test/gtest/type-builder.cpp | 22 | ||||
-rw-r--r-- | test/lit/fuzz-types.test | 82 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz_all-features_metrics_noprint.txt | 76 |
7 files changed, 90 insertions, 417 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 760f4be1d..2c6ec2d6c 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -2134,8 +2134,8 @@ void test_typebuilder() { TypeBuilderRef builder = TypeBuilderCreate(0); assert(TypeBuilderGetSize(builder) == 0); - TypeBuilderGrow(builder, 5); - assert(TypeBuilderGetSize(builder) == 5); + TypeBuilderGrow(builder, 4); + assert(TypeBuilderGetSize(builder) == 4); // Create a recursive array of its own type const BinaryenIndex tempArrayIndex = 0; @@ -2179,19 +2179,8 @@ void test_typebuilder() { tempSignatureType); } - // Create a basic heap type - const BinaryenIndex tempBasicIndex = 3; - TypeBuilderSetBasicHeapType( - builder, 3, BinaryenTypeGetHeapType(BinaryenTypeEqref())); - assert(TypeBuilderIsBasic(builder, tempBasicIndex)); - assert(TypeBuilderGetBasic(builder, tempBasicIndex) == - BinaryenTypeGetHeapType(BinaryenTypeEqref())); - assert(!TypeBuilderIsBasic(builder, tempArrayIndex)); - assert(!TypeBuilderIsBasic(builder, tempStructIndex)); - assert(!TypeBuilderIsBasic(builder, tempSignatureIndex)); - // Create a subtype (with an additional immutable packed field) - const BinaryenIndex tempSubStructIndex = 4; + const BinaryenIndex tempSubStructIndex = 3; BinaryenHeapType tempSubStructHeapType = TypeBuilderGetTempHeapType(builder, tempSubStructIndex); BinaryenType tempSubStructType = @@ -2214,7 +2203,7 @@ void test_typebuilder() { // TODO: Rtts (post-MVP?) // Build the type hierarchy and dispose the builder - BinaryenHeapType heapTypes[5]; + BinaryenHeapType heapTypes[4]; BinaryenIndex errorIndex; TypeBuilderErrorReason errorReason; bool didBuildAndDispose = TypeBuilderBuildAndDispose( @@ -2222,7 +2211,6 @@ void test_typebuilder() { assert(didBuildAndDispose); BinaryenHeapType arrayHeapType = heapTypes[tempArrayIndex]; - assert(!BinaryenHeapTypeIsBasic(arrayHeapType)); assert(!BinaryenHeapTypeIsSignature(arrayHeapType)); assert(!BinaryenHeapTypeIsStruct(arrayHeapType)); assert(BinaryenHeapTypeIsArray(arrayHeapType)); @@ -2235,7 +2223,6 @@ void test_typebuilder() { assert(BinaryenArrayTypeIsElementMutable(arrayHeapType)); BinaryenHeapType structHeapType = heapTypes[tempStructIndex]; - assert(!BinaryenHeapTypeIsBasic(structHeapType)); assert(!BinaryenHeapTypeIsSignature(structHeapType)); assert(BinaryenHeapTypeIsStruct(structHeapType)); assert(!BinaryenHeapTypeIsArray(structHeapType)); @@ -2249,7 +2236,6 @@ void test_typebuilder() { assert(BinaryenStructTypeIsFieldMutable(structHeapType, 0)); BinaryenHeapType signatureHeapType = heapTypes[tempSignatureIndex]; - assert(!BinaryenHeapTypeIsBasic(signatureHeapType)); assert(BinaryenHeapTypeIsSignature(signatureHeapType)); assert(!BinaryenHeapTypeIsStruct(signatureHeapType)); assert(!BinaryenHeapTypeIsArray(signatureHeapType)); @@ -2269,17 +2255,7 @@ void test_typebuilder() { assert(BinaryenTypeArity(signatureResults) == 1); assert(signatureResults == signatureType); - BinaryenHeapType basicHeapType = heapTypes[tempBasicIndex]; // = eq - assert(BinaryenHeapTypeIsBasic(basicHeapType)); - assert(!BinaryenHeapTypeIsSignature(basicHeapType)); - assert(!BinaryenHeapTypeIsStruct(basicHeapType)); - assert(!BinaryenHeapTypeIsArray(basicHeapType)); - assert(!BinaryenHeapTypeIsBottom(basicHeapType)); - assert(BinaryenHeapTypeIsSubType(basicHeapType, BinaryenHeapTypeAny())); - BinaryenType basicType = BinaryenTypeFromHeapType(basicHeapType, true); - BinaryenHeapType subStructHeapType = heapTypes[tempSubStructIndex]; - assert(!BinaryenHeapTypeIsBasic(subStructHeapType)); assert(!BinaryenHeapTypeIsSignature(subStructHeapType)); assert(BinaryenHeapTypeIsStruct(subStructHeapType)); assert(!BinaryenHeapTypeIsArray(subStructHeapType)); @@ -2306,7 +2282,6 @@ void test_typebuilder() { BinaryenModuleSetTypeName(module, structHeapType, "SomeStruct"); BinaryenModuleSetFieldName(module, structHeapType, 0, "SomeField"); BinaryenModuleSetTypeName(module, signatureHeapType, "SomeSignature"); - BinaryenModuleSetTypeName(module, basicHeapType, "does-nothing"); BinaryenModuleSetTypeName(module, subStructHeapType, "SomeSubStruct"); BinaryenModuleSetFieldName(module, subStructHeapType, 0, "SomeField"); BinaryenModuleSetFieldName(module, subStructHeapType, 1, "SomePackedField"); @@ -2314,13 +2289,13 @@ void test_typebuilder() { module, BinaryenFeatureReferenceTypes() | BinaryenFeatureGC()); { BinaryenType varTypes[] = { - arrayType, structType, signatureType, basicType, subStructType}; + arrayType, structType, signatureType, subStructType}; BinaryenAddFunction(module, "test", BinaryenTypeNone(), BinaryenTypeNone(), varTypes, - 5, + 4, BinaryenNop(module)); } bool didValidate = BinaryenModuleValidate(module); diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 1c1a3b956..f9b688eaf 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -3162,8 +3162,7 @@ module with recursive GC types: (local $0 (ref null $SomeArray)) (local $1 (ref null $SomeStruct)) (local $2 (ref null $SomeSignature)) - (local $3 eqref) - (local $4 (ref null $SomeSubStruct)) + (local $3 (ref null $SomeSubStruct)) (nop) ) ) diff --git a/test/example/type-builder.cpp b/test/example/type-builder.cpp deleted file mode 100644 index 2ce064b5f..000000000 --- a/test/example/type-builder.cpp +++ /dev/null @@ -1,233 +0,0 @@ -#include <cassert> -#include <iostream> - -#include "wasm-type-printing.h" -#include "wasm-type.h" - -using namespace wasm; - -// Check that the builder works when there are duplicate definitions -void test_canonicalization() { - std::cout << ";; Test canonicalization\n"; - - // (type $struct (struct (field (ref null $sig) (ref null $sig)))) - // (type $sig (func)) - HeapType sig = Signature(Type::none, Type::none); - HeapType struct_ = Struct({Field(Type(sig, Nullable), Immutable), - Field(Type(sig, Nullable), Immutable)}); - - TypeBuilder builder(4); - - Type tempSigRef1 = builder.getTempRefType(builder[0], Nullable); - Type tempSigRef2 = builder.getTempRefType(builder[1], Nullable); - - assert(tempSigRef1 != tempSigRef2); - assert(tempSigRef1 != Type(sig, Nullable)); - assert(tempSigRef2 != Type(sig, Nullable)); - - builder[0] = Signature(Type::none, Type::none); - builder[1] = Signature(Type::none, Type::none); - builder[2] = - Struct({Field(tempSigRef1, Immutable), Field(tempSigRef1, Immutable)}); - builder[3] = - Struct({Field(tempSigRef2, Immutable), Field(tempSigRef2, Immutable)}); - - std::vector<HeapType> built = *builder.build(); - - assert(built[0] == sig); - assert(built[1] == sig); - assert(built[2] == struct_); - assert(built[3] == struct_); -} - -// Check that defined basic HeapTypes are handled correctly. -void test_basic() { - std::cout << ";; Test basic\n"; - - Type canonAnyref = Type(HeapType::any, Nullable); - Type canonI31ref = Type(HeapType::i31, NonNullable); - - TypeBuilder builder(6); - - Type anyref = builder.getTempRefType(builder[4], Nullable); - Type i31ref = builder.getTempRefType(builder[5], NonNullable); - - builder[0] = Signature(canonAnyref, canonI31ref); - builder[1] = Signature(anyref, canonI31ref); - builder[2] = Signature(canonAnyref, i31ref); - builder[3] = Signature(anyref, i31ref); - builder[4] = HeapType::any; - builder[5] = HeapType::i31; - - std::vector<HeapType> built = *builder.build(); - - assert(built[0] == Signature(canonAnyref, canonI31ref)); - assert(built[1] == built[0]); - assert(built[2] == built[1]); - assert(built[3] == built[2]); - assert(built[4] == HeapType::any); - assert(built[5] == HeapType::i31); -} - -void test_recursive() { - std::cout << ";; Test recursive types\n"; - - { - // Trivial recursion - std::vector<HeapType> built; - { - TypeBuilder builder(1); - Type temp = builder.getTempRefType(builder[0], Nullable); - builder[0] = Signature(Type::none, temp); - built = *builder.build(); - } - IndexedTypeNameGenerator print(built); - std::cout << print(built[0]) << "\n\n"; - assert(built[0] == built[0].getSignature().results.getHeapType()); - assert(Type(built[0], Nullable) == built[0].getSignature().results); - } - - { - // Mutual recursion - std::vector<HeapType> built; - { - TypeBuilder builder(2); - builder.createRecGroup(0, 2); - Type temp0 = builder.getTempRefType(builder[0], Nullable); - Type temp1 = builder.getTempRefType(builder[1], Nullable); - builder[0] = Signature(Type::none, temp1); - builder[1] = Signature(Type::none, temp0); - built = *builder.build(); - } - IndexedTypeNameGenerator print(built); - std::cout << print(built[0]) << "\n"; - std::cout << print(built[1]) << "\n\n"; - assert(built[0].getSignature().results.getHeapType() == built[1]); - assert(built[1].getSignature().results.getHeapType() == built[0]); - } - - { - // A longer chain of recursion - std::vector<HeapType> built; - { - TypeBuilder builder(5); - builder.createRecGroup(0, 5); - Type temp0 = builder.getTempRefType(builder[0], Nullable); - Type temp1 = builder.getTempRefType(builder[1], Nullable); - Type temp2 = builder.getTempRefType(builder[2], Nullable); - Type temp3 = builder.getTempRefType(builder[3], Nullable); - Type temp4 = builder.getTempRefType(builder[4], Nullable); - builder[0] = Signature(Type::none, temp1); - builder[1] = Signature(Type::none, temp2); - builder[2] = Signature(Type::none, temp3); - builder[3] = Signature(Type::none, temp4); - builder[4] = Signature(Type::none, temp0); - built = *builder.build(); - } - IndexedTypeNameGenerator print(built); - std::cout << print(built[0]) << "\n"; - std::cout << print(built[1]) << "\n"; - std::cout << print(built[2]) << "\n"; - std::cout << print(built[3]) << "\n"; - std::cout << print(built[4]) << "\n\n"; - assert(built[0].getSignature().results.getHeapType() == built[1]); - assert(built[1].getSignature().results.getHeapType() == built[2]); - assert(built[2].getSignature().results.getHeapType() == built[3]); - assert(built[3].getSignature().results.getHeapType() == built[4]); - assert(built[4].getSignature().results.getHeapType() == built[0]); - assert(built[0] != built[1]); - assert(built[1] != built[2]); - assert(built[2] != built[3]); - assert(built[3] != built[4]); - } - - { - // Check canonicalization for non-recursive parents and children of - // recursive HeapTypes. - std::vector<HeapType> built; - { - TypeBuilder builder(6); - Type temp0 = builder.getTempRefType(builder[0], Nullable); - Type temp1 = builder.getTempRefType(builder[1], Nullable); - Type temp2 = builder.getTempRefType(builder[2], Nullable); - Type temp3 = builder.getTempRefType(builder[3], Nullable); - Type tuple0_2 = builder.getTempTupleType({temp0, temp2}); - Type tuple1_3 = builder.getTempTupleType({temp1, temp3}); - builder[0] = Signature(); - builder[1] = Signature(); - builder.createRecGroup(2, 2); - builder[2] = Signature(Type::none, tuple0_2); - builder[3] = Signature(Type::none, tuple1_3); - builder[4] = Signature(Type::none, temp2); - builder[5] = Signature(Type::none, temp3); - built = *builder.build(); - } - IndexedTypeNameGenerator print(built); - std::cout << print(built[0]) << "\n"; - std::cout << print(built[1]) << "\n"; - std::cout << print(built[2]) << "\n"; - std::cout << print(built[3]) << "\n"; - std::cout << print(built[4]) << "\n"; - std::cout << print(built[5]) << "\n\n"; - assert(built[0] == built[1]); - assert(built[2] != built[3]); - assert(built[4] != built[5]); - assert(built[4].getSignature().results.getHeapType() == built[2]); - assert(built[5].getSignature().results.getHeapType() == built[3]); - assert(built[2].getSignature().results == - Type({Type(built[0], Nullable), Type(built[2], Nullable)})); - assert(built[3].getSignature().results == - Type({Type(built[1], Nullable), Type(built[3], Nullable)})); - } - - { - // Folded and unfolded - std::vector<HeapType> built; - { - TypeBuilder builder(2); - Type temp0 = builder.getTempRefType(builder[0], Nullable); - builder[0] = Signature(Type::none, temp0); - builder[1] = Signature(Type::none, temp0); - built = *builder.build(); - } - IndexedTypeNameGenerator print(built); - std::cout << print(built[0]) << "\n"; - std::cout << print(built[1]) << "\n\n"; - assert(built[0].getSignature().results.getHeapType() == built[0]); - assert(built[1].getSignature().results.getHeapType() == built[0]); - assert(built[0] != built[1]); - } - - { - // Including a basic heap type - std::vector<HeapType> built; - { - TypeBuilder builder(3); - Type anyref = builder.getTempRefType(builder[0], Nullable); - Type temp1 = builder.getTempRefType(builder[1], Nullable); - builder[0] = HeapType::any; - builder[1] = Signature(anyref, temp1); - builder[2] = Signature(anyref, temp1); - built = *builder.build(); - } - IndexedTypeNameGenerator print(built); - std::cout << print(built[0]) << "\n"; - std::cout << print(built[1]) << "\n\n"; - assert(built[0] == HeapType::any); - assert(built[1].getSignature().results.getHeapType() == built[1]); - assert(built[2].getSignature().results.getHeapType() == built[1]); - assert(built[1].getSignature().params == Type(HeapType::any, Nullable)); - assert(built[2].getSignature().params == Type(HeapType::any, Nullable)); - assert(built[1] != built[2]); - } -} - -int main() { - // Run the tests twice to ensure things still work when the global stores are - // already populated. - for (size_t i = 0; i < 2; ++i) { - test_canonicalization(); - test_basic(); - test_recursive(); - } -} diff --git a/test/example/type-builder.txt b/test/example/type-builder.txt deleted file mode 100644 index b0cff3cc0..000000000 --- a/test/example/type-builder.txt +++ /dev/null @@ -1,54 +0,0 @@ -;; Test canonicalization -;; Test basic -;; Test recursive types -(type $0 (func (result (ref null $0)))) - -(type $0 (func (result (ref null $1)))) -(type $1 (func (result (ref null $0)))) - -(type $0 (func (result (ref null $1)))) -(type $1 (func (result (ref null $2)))) -(type $2 (func (result (ref null $3)))) -(type $3 (func (result (ref null $4)))) -(type $4 (func (result (ref null $0)))) - -(type $0 (func)) -(type $0 (func)) -(type $2 (func (result (ref null $0) (ref null $2)))) -(type $3 (func (result (ref null $0) (ref null $3)))) -(type $4 (func (result (ref null $2)))) -(type $5 (func (result (ref null $3)))) - -(type $0 (func (result (ref null $0)))) -(type $1 (func (result (ref null $0)))) - -any -(type $1 (func (param anyref) (result (ref null $1)))) - -;; Test canonicalization -;; Test basic -;; Test recursive types -(type $0 (func (result (ref null $0)))) - -(type $0 (func (result (ref null $1)))) -(type $1 (func (result (ref null $0)))) - -(type $0 (func (result (ref null $1)))) -(type $1 (func (result (ref null $2)))) -(type $2 (func (result (ref null $3)))) -(type $3 (func (result (ref null $4)))) -(type $4 (func (result (ref null $0)))) - -(type $0 (func)) -(type $0 (func)) -(type $2 (func (result (ref null $0) (ref null $2)))) -(type $3 (func (result (ref null $0) (ref null $3)))) -(type $4 (func (result (ref null $2)))) -(type $5 (func (result (ref null $3)))) - -(type $0 (func (result (ref null $0)))) -(type $1 (func (result (ref null $0)))) - -any -(type $1 (func (param anyref) (result (ref null $1)))) - diff --git a/test/gtest/type-builder.cpp b/test/gtest/type-builder.cpp index 7d5f5aa98..84b9f33c8 100644 --- a/test/gtest/type-builder.cpp +++ b/test/gtest/type-builder.cpp @@ -489,28 +489,6 @@ TEST_F(TypeTest, CanonicalizeTypesBeforeSubtyping) { EXPECT_TRUE(result); } -TEST_F(TypeTest, CanonicalizeBasicTypes) { - TypeBuilder builder(5); - - Type anyref = builder.getTempRefType(builder[0], Nullable); - Type anyrefs = builder.getTempTupleType({anyref, anyref}); - - Type anyrefCanon = Type(HeapType::any, Nullable); - - builder[0] = HeapType::any; - builder[1] = Struct({Field(anyref, Immutable)}); - builder[2] = Struct({Field(anyrefCanon, Immutable)}); - builder[3] = Signature(anyrefs, Type::none); - builder[4] = Signature({anyrefCanon, anyrefCanon}, Type::none); - - auto result = builder.build(); - ASSERT_TRUE(result); - auto built = *result; - - EXPECT_EQ(built[1], built[2]); - EXPECT_EQ(built[3], built[4]); -} - TEST_F(TypeTest, TestHeapTypeRelations) { HeapType ext = HeapType::ext; HeapType func = HeapType::func; diff --git a/test/lit/fuzz-types.test b/test/lit/fuzz-types.test index b10df152b..c1748e646 100644 --- a/test/lit/fuzz-types.test +++ b/test/lit/fuzz-types.test @@ -1,66 +1,66 @@ ;; RUN: wasm-fuzz-types -v --seed=1 | filecheck %s -;; CHECK: (type $0 (struct)) -;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $1 (struct)) -;; CHECK-NEXT: (type $2 (array i16)) -;; CHECK-NEXT: (type $3 (func)) -;; CHECK-NEXT: (type $4 (func (param (ref $5) i32 i64 f64 f64 (ref eq) v128) (result i64))) -;; CHECK-NEXT: (type $5 (array (mut i32))) +;; CHECK: (rec +;; CHECK-NEXT: (type $0 (struct (field (mut (ref $1)) f64 v128 (mut (ref null $1)) (mut (ref null $0)) (ref $1)))) +;; CHECK-NEXT: (type $1 (struct (field (mut v128) (mut (ref null $1)) (mut i8) (mut i16) (mut i16)))) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $6 (array (mut funcref))) -;; CHECK-NEXT: (type $7 (func (param f64) (result i64))) +;; CHECK-NEXT: (type $2 (array (mut i16))) +;; CHECK-NEXT: (type $3 (func)) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $8 (struct_subtype (field f64 (ref $2) f64 (mut (ref null $9))) $1)) -;; CHECK-NEXT: (type $9 (func_subtype (param (ref array) i32 i64 f64 f64 anyref v128) (result i64) $4)) +;; CHECK-NEXT: (type $4 (func (param f32) (result f64))) +;; CHECK-NEXT: (type $5 (array v128)) +;; CHECK-NEXT: (type $6 (array (mut (ref null $3)))) +;; CHECK-NEXT: (type $7 (func (param v128) (result f32))) +;; CHECK-NEXT: (type $8 (struct_subtype (field (mut v128) (mut (ref null $1)) (mut i8) (mut i16) (mut i16) (mut i64)) $1)) ;; CHECK-NEXT: ) +;; CHECK-NEXT: (type $9 (func_subtype (param v128) (result f32) $7)) +;; CHECK-NEXT: (type $10 (struct_subtype (field (mut (ref $1)) f64 v128 (mut (ref null $1)) (mut (ref null $0)) (ref $1)) $0)) ;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $10 (func_subtype (param (ref eq) i32 i64 f64 f64 anyref v128) (result i64) $9)) -;; CHECK-NEXT: (type $11 (array_subtype (mut funcref) $6)) -;; CHECK-NEXT: (type $12 (array nullref)) -;; CHECK-NEXT: (type $13 none) -;; CHECK-NEXT: (type $14 (array (ref $6))) -;; CHECK-NEXT: (type $15 (array i32)) +;; CHECK-NEXT: (type $11 (struct)) +;; CHECK-NEXT: (type $12 (struct (field (mut i32) (mut i32) v128))) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $16 (array_subtype (ref none) $12)) -;; CHECK-NEXT: (type $17 (func (param (ref null $9)) (result f32 structref))) -;; CHECK-NEXT: (type $18 none) +;; CHECK-NEXT: (type $13 (func (param (ref null $4)) (result f32))) +;; CHECK-NEXT: (type $14 (array_subtype (mut i16) $2)) +;; CHECK-NEXT: (type $15 (struct (field (mut v128) (ref extern) (mut (ref $15))))) +;; CHECK-NEXT: (type $16 (struct_subtype (field (mut v128) (ref extern) (mut (ref $15))) $15)) +;; CHECK-NEXT: (type $17 (struct_subtype (field (mut (ref $1)) f64 v128 (mut (ref null $1)) (mut (ref null $0)) (ref $1)) $0)) +;; CHECK-NEXT: (type $18 (func_subtype (param f32) (result f64) $4)) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (type $19 (func_subtype (param (ref any) i32 i64 f64 f64 anyref v128) (result i64) $9)) +;; CHECK-NEXT: (type $19 (func (result v128))) ;; CHECK-NEXT: ;; CHECK-NEXT: Inhabitable types: ;; CHECK-NEXT: ;; CHECK-NEXT: Built 20 types: -;; CHECK-NEXT: (type $0 (struct)) ;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $1 (struct)) -;; CHECK-NEXT: (type $2 (array i16)) -;; CHECK-NEXT: (type $3 (func)) -;; CHECK-NEXT: (type $4 (func (param (ref $5) i32 i64 f64 f64 (ref eq) v128) (result i64))) -;; CHECK-NEXT: (type $5 (array (mut i32))) +;; CHECK-NEXT: (type $0 (struct (field (mut (ref $1)) f64 v128 (mut (ref null $1)) (mut (ref null $0)) (ref $1)))) +;; CHECK-NEXT: (type $1 (struct (field (mut v128) (mut (ref null $1)) (mut i8) (mut i16) (mut i16)))) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $6 (array (mut funcref))) -;; CHECK-NEXT: (type $7 (func (param f64) (result i64))) +;; CHECK-NEXT: (type $2 (array (mut i16))) +;; CHECK-NEXT: (type $3 (func)) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $8 (struct_subtype (field f64 (ref $2) f64 (mut (ref null $9))) $1)) -;; CHECK-NEXT: (type $9 (func_subtype (param (ref array) i32 i64 f64 f64 anyref v128) (result i64) $4)) +;; CHECK-NEXT: (type $4 (func (param f32) (result f64))) +;; CHECK-NEXT: (type $5 (array v128)) +;; CHECK-NEXT: (type $6 (array (mut (ref null $3)))) +;; CHECK-NEXT: (type $7 (func (param v128) (result f32))) +;; CHECK-NEXT: (type $8 (struct_subtype (field (mut v128) (mut (ref null $1)) (mut i8) (mut i16) (mut i16) (mut i64)) $1)) ;; CHECK-NEXT: ) +;; CHECK-NEXT: (type $9 (func_subtype (param v128) (result f32) $7)) +;; CHECK-NEXT: (type $10 (struct_subtype (field (mut (ref $1)) f64 v128 (mut (ref null $1)) (mut (ref null $0)) (ref $1)) $0)) ;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $10 (func_subtype (param (ref eq) i32 i64 f64 f64 anyref v128) (result i64) $9)) -;; CHECK-NEXT: (type $11 (array_subtype (mut funcref) $6)) -;; CHECK-NEXT: (type $12 (array nullref)) -;; CHECK-NEXT: (type $13 none) -;; CHECK-NEXT: (type $14 (array (ref $6))) -;; CHECK-NEXT: (type $15 (array i32)) +;; CHECK-NEXT: (type $11 (struct)) +;; CHECK-NEXT: (type $12 (struct (field (mut i32) (mut i32) v128))) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (rec -;; CHECK-NEXT: (type $16 (array_subtype nullref $12)) -;; CHECK-NEXT: (type $17 (func (param (ref null $9)) (result f32 structref))) -;; CHECK-NEXT: (type $18 none) +;; CHECK-NEXT: (type $13 (func (param (ref null $4)) (result f32))) +;; CHECK-NEXT: (type $14 (array_subtype (mut i16) $2)) +;; CHECK-NEXT: (type $15 (struct (field (mut v128) externref (mut (ref null $15))))) +;; CHECK-NEXT: (type $16 (struct_subtype (field (mut v128) externref (mut (ref null $15))) $15)) +;; CHECK-NEXT: (type $17 (struct_subtype (field (mut (ref $1)) f64 v128 (mut (ref null $1)) (mut (ref null $0)) (ref $1)) $0)) +;; CHECK-NEXT: (type $18 (func_subtype (param f32) (result f64) $4)) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (type $19 (func_subtype (param (ref any) i32 i64 f64 f64 anyref v128) (result i64) $9)) +;; CHECK-NEXT: (type $19 (func (result v128))) diff --git a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt index 16eb0cbd8..b82f34f20 100644 --- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt +++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt @@ -1,47 +1,55 @@ total - [exports] : 6 - [funcs] : 15 + [exports] : 4 + [funcs] : 7 [globals] : 16 [imports] : 5 [memories] : 1 [memory-data] : 20 - [table-data] : 3 + [table-data] : 0 [tables] : 1 - [tags] : 2 - [total] : 725 - [vars] : 22 + [tags] : 0 + [total] : 600 + [vars] : 17 ArrayFill : 1 ArrayLen : 3 - ArrayNew : 7 + ArrayNew : 12 + ArrayNewFixed : 2 ArraySet : 2 AtomicCmpxchg : 1 AtomicFence : 1 - AtomicNotify : 3 - Binary : 85 - Block : 90 - Break : 14 - Call : 14 - CallIndirect : 1 - Const : 173 - Drop : 4 - GlobalGet : 40 - GlobalSet : 40 - I31New : 1 - If : 29 - Load : 17 - LocalGet : 42 - LocalSet : 28 - Loop : 6 - Nop : 13 - RefAs : 7 + AtomicNotify : 1 + AtomicRMW : 2 + Binary : 73 + Block : 51 + Break : 5 + Call : 10 + CallRef : 3 + Const : 162 + DataDrop : 1 + Drop : 1 + GlobalGet : 21 + GlobalSet : 20 + I31Get : 1 + I31New : 4 + If : 21 + Load : 22 + LocalGet : 43 + LocalSet : 29 + Loop : 4 + MemoryFill : 1 + Nop : 8 + RefAs : 5 + RefCast : 2 + RefEq : 2 RefFunc : 9 - RefNull : 12 - Return : 4 - SIMDExtract : 1 - Store : 5 - StructGet : 2 - StructNew : 7 + RefIsNull : 4 + RefNull : 8 + RefTest : 2 + Return : 6 + Select : 2 + Store : 2 + StructNew : 18 TupleExtract : 2 - TupleMake : 10 - Unary : 28 - Unreachable : 23 + TupleMake : 4 + Unary : 19 + Unreachable : 10 |