summaryrefslogtreecommitdiff
path: root/test/gtest
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2022-11-22 23:41:49 -0600
committerGitHub <noreply@github.com>2022-11-23 05:41:49 +0000
commit2c0fb8c513b3534576383d250c593a9bd28347e3 (patch)
tree993b23de3e8e5007fd3a32242cda95e7172ad765 /test/gtest
parent853b31ec89416bef0014e06f2defaef74f47b81e (diff)
downloadbinaryen-2c0fb8c513b3534576383d250c593a9bd28347e3.tar.gz
binaryen-2c0fb8c513b3534576383d250c593a9bd28347e3.tar.bz2
binaryen-2c0fb8c513b3534576383d250c593a9bd28347e3.zip
Remove equirecursive typing (#5240)
Equirecursive is no longer standards track and its implementation is extremely complex. Remove it.
Diffstat (limited to 'test/gtest')
-rw-r--r--test/gtest/type-builder.cpp21
-rw-r--r--test/gtest/type-test.h1
2 files changed, 8 insertions, 14 deletions
diff --git a/test/gtest/type-builder.cpp b/test/gtest/type-builder.cpp
index fcf0e1a5a..0dba0a10c 100644
--- a/test/gtest/type-builder.cpp
+++ b/test/gtest/type-builder.cpp
@@ -103,22 +103,22 @@ TEST_F(TypeTest, IndexedTypePrinter) {
std::stringstream stream;
stream << print(built[0]);
- EXPECT_EQ(stream.str(), "(struct_subtype (field (ref null $array1)) data)");
+ EXPECT_EQ(stream.str(), "(struct (field (ref null $array1)))");
stream.str("");
stream << print(built[1]);
- EXPECT_EQ(stream.str(), "(struct_subtype (field (ref null $struct0)) data)");
+ EXPECT_EQ(stream.str(), "(struct (field (ref null $struct0)))");
stream.str("");
stream << print(built[2]);
- EXPECT_EQ(stream.str(), "(array_subtype (ref null $struct1) data)");
+ EXPECT_EQ(stream.str(), "(array (ref null $struct1))");
stream.str("");
stream << print(built[3]);
- EXPECT_EQ(stream.str(), "(array_subtype (ref null $array0) data)");
+ EXPECT_EQ(stream.str(), "(array (ref null $array0))");
}
-TEST_F(EquirecursiveTest, Basics) {
+TEST_F(IsorecursiveTest, Basics) {
// (type $sig (func (param (ref $struct)) (result (ref $array) i32)))
// (type $struct (struct (field (ref null $array))))
// (type $array (array (mut anyref)))
@@ -139,6 +139,8 @@ TEST_F(EquirecursiveTest, Basics) {
builder[1] = struct_;
builder[2] = array;
+ builder.createRecGroup(0, 3);
+
auto result = builder.build();
ASSERT_TRUE(result);
std::vector<HeapType> built = *result;
@@ -470,7 +472,7 @@ TEST_F(IsorecursiveTest, CanonicalizeTypesBeforeSubtyping) {
EXPECT_TRUE(result);
}
-static void testCanonicalizeBasicTypes() {
+TEST_F(IsorecursiveTest, CanonicalizeBasicTypes) {
TypeBuilder builder(5);
Type anyref = builder.getTempRefType(builder[0], Nullable);
@@ -492,13 +494,6 @@ static void testCanonicalizeBasicTypes() {
EXPECT_EQ(built[3], built[4]);
}
-TEST_F(EquirecursiveTest, CanonicalizeBasicTypes) {
- testCanonicalizeBasicTypes();
-}
-TEST_F(IsorecursiveTest, CanonicalizeBasicTypes) {
- testCanonicalizeBasicTypes();
-}
-
TEST_F(IsorecursiveTest, TestHeapTypeRelations) {
HeapType ext = HeapType::ext;
HeapType func = HeapType::func;
diff --git a/test/gtest/type-test.h b/test/gtest/type-test.h
index fffcbd3dd..49c6381fa 100644
--- a/test/gtest/type-test.h
+++ b/test/gtest/type-test.h
@@ -33,7 +33,6 @@ protected:
};
using TypeTest = TypeSystemTest<wasm::TypeSystem::Isorecursive>;
-using EquirecursiveTest = TypeSystemTest<wasm::TypeSystem::Equirecursive>;
using NominalTest = TypeSystemTest<wasm::TypeSystem::Nominal>;
using IsorecursiveTest = TypeSystemTest<wasm::TypeSystem::Isorecursive>;