summaryrefslogtreecommitdiff
path: root/test/example
diff options
context:
space:
mode:
Diffstat (limited to 'test/example')
-rw-r--r--test/example/c-api-kitchen-sink.txt14
-rw-r--r--test/example/stack-utils.cpp4
-rw-r--r--test/example/type-builder-nominal.cpp7
-rw-r--r--test/example/type-builder-nominal.txt8
-rw-r--r--test/example/type-builder.cpp1
-rw-r--r--test/example/typeinfo.cpp23
-rw-r--r--test/example/typeinfo.txt13
7 files changed, 24 insertions, 46 deletions
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 95d1a1ed6..49a3d74b1 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -7,10 +7,10 @@
// BinaryenTypeVec128: 6
// BinaryenTypeFuncref: 7
// BinaryenTypeExternref: 8
- // BinaryenTypeAnyref: 9
- // BinaryenTypeEqref: 10
- // BinaryenTypeI31ref: 11
- // BinaryenTypeDataref: 12
+ // BinaryenTypeAnyref: 8
+ // BinaryenTypeEqref: 9
+ // BinaryenTypeI31ref: 10
+ // BinaryenTypeDataref: 11
// BinaryenTypeAuto: -1
BinaryenFeatureMVP: 0
BinaryenFeatureAtomics: 1
@@ -65,7 +65,7 @@ BinaryenFeatureAll: 57343
(start $starter)
(func "$kitchen()sinker" (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
(local $4 i32)
- (local $5 externref)
+ (local $5 anyref)
(block $the-body (result i32)
(block $the-nothing
(drop
@@ -1946,7 +1946,7 @@ BinaryenFeatureAll: 57343
)
(drop
(ref.is_null
- (ref.null extern)
+ (ref.null any)
)
)
(drop
@@ -2086,7 +2086,7 @@ BinaryenFeatureAll: 57343
(pop funcref)
)
(drop
- (pop externref)
+ (pop anyref)
)
(drop
(pop i32 i64 f32 f64)
diff --git a/test/example/stack-utils.cpp b/test/example/stack-utils.cpp
index b5ac496ca..8709396f9 100644
--- a/test/example/stack-utils.cpp
+++ b/test/example/stack-utils.cpp
@@ -392,7 +392,7 @@ void test_signature_lub() {
(StackSignature{Type::i32, Type::i32, StackSignature::Polymorphic}));
}
{
- StackSignature a{Type::none, Type::externref, StackSignature::Polymorphic};
+ StackSignature a{Type::none, Type::anyref, StackSignature::Polymorphic};
StackSignature b{Type::none, Type::funcref, StackSignature::Polymorphic};
assert(StackSignature::haveLeastUpperBound(a, b));
assert(
@@ -411,7 +411,7 @@ void test_signature_lub() {
StackSignature a{
{Type::i32, Type::funcref}, Type::funcref, StackSignature::Polymorphic};
StackSignature b{
- Type::funcref, {Type::f32, Type::externref}, StackSignature::Polymorphic};
+ Type::funcref, {Type::f32, Type::anyref}, StackSignature::Polymorphic};
assert(StackSignature::haveLeastUpperBound(a, b));
assert(StackSignature::getLeastUpperBound(a, b) ==
(StackSignature{{Type::i32, Type::funcref},
diff --git a/test/example/type-builder-nominal.cpp b/test/example/type-builder-nominal.cpp
index 5bfefadc3..34571c48e 100644
--- a/test/example/type-builder-nominal.cpp
+++ b/test/example/type-builder-nominal.cpp
@@ -12,7 +12,7 @@ void test_builder() {
// (type $sig (func (param (ref $struct)) (result (ref $array) i32)))
// (type $struct (struct (field (ref null $array) (mut rtt 0 $array))))
- // (type $array (array (mut externref)))
+ // (type $array (array (mut anyref)))
TypeBuilder builder;
assert(builder.size() == 0);
@@ -24,11 +24,11 @@ void test_builder() {
Type refArray = builder.getTempRefType(builder[2], NonNullable);
Type refNullArray = builder.getTempRefType(builder[2], Nullable);
Type rttArray = builder.getTempRttType(Rtt(0, builder[2]));
- Type refNullExt(HeapType::ext, Nullable);
+ Type refNullAny(HeapType::any, Nullable);
Signature sig(refStruct, builder.getTempTupleType({refArray, Type::i32}));
Struct struct_({Field(refNullArray, Immutable), Field(rttArray, Mutable)});
- Array array(Field(refNullExt, Mutable));
+ Array array(Field(refNullAny, Mutable));
{
IndexedTypeNameGenerator print(builder);
@@ -327,7 +327,6 @@ void test_subtypes() {
{
// Basic Types
for (auto other : {HeapType::func,
- HeapType::ext,
HeapType::any,
HeapType::eq,
HeapType::i31,
diff --git a/test/example/type-builder-nominal.txt b/test/example/type-builder-nominal.txt
index 8d1fe67e4..745f63df2 100644
--- a/test/example/type-builder-nominal.txt
+++ b/test/example/type-builder-nominal.txt
@@ -12,7 +12,7 @@ $array => (; temp ;) (func_subtype func)
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) (mut (; temp ;) (rtt 0 $2))) data)
-$array => (; temp ;) (array_subtype (mut externref) data)
+$array => (; temp ;) (array_subtype (mut anyref) data)
(ref $sig) => (; temp ;) (ref $0)
(ref $struct) => (; temp ;) (ref $1)
(ref $array) => (; temp ;) (ref $2)
@@ -22,7 +22,7 @@ $array => (; temp ;) (array_subtype (mut externref) data)
After building types:
$sig => (func_subtype (param (ref $1)) (result (ref $2) i32) func)
$struct => (struct_subtype (field (ref null $2) (mut (rtt 0 $2))) data)
-$array => (array_subtype (mut externref) data)
+$array => (array_subtype (mut anyref) data)
(ref $sig) => (ref $0)
(ref $struct) => (ref $1)
(ref $array) => (ref $2)
@@ -69,7 +69,7 @@ $array => (; temp ;) (func_subtype func)
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) (mut (; temp ;) (rtt 0 $2))) data)
-$array => (; temp ;) (array_subtype (mut externref) data)
+$array => (; temp ;) (array_subtype (mut anyref) data)
(ref $sig) => (; temp ;) (ref $0)
(ref $struct) => (; temp ;) (ref $1)
(ref $array) => (; temp ;) (ref $2)
@@ -79,7 +79,7 @@ $array => (; temp ;) (array_subtype (mut externref) data)
After building types:
$sig => (func_subtype (param (ref $1)) (result (ref $2) i32) func)
$struct => (struct_subtype (field (ref null $2) (mut (rtt 0 $2))) data)
-$array => (array_subtype (mut externref) data)
+$array => (array_subtype (mut anyref) data)
(ref $sig) => (ref $0)
(ref $struct) => (ref $1)
(ref $array) => (ref $2)
diff --git a/test/example/type-builder.cpp b/test/example/type-builder.cpp
index 318e48f2e..ce7b74841 100644
--- a/test/example/type-builder.cpp
+++ b/test/example/type-builder.cpp
@@ -239,7 +239,6 @@ void test_lub() {
{
// Basic Types
for (auto other : {Type::funcref,
- Type::externref,
Type::anyref,
Type::eqref,
Type::i31ref,
diff --git a/test/example/typeinfo.cpp b/test/example/typeinfo.cpp
index dd8e13d43..ed5637bd9 100644
--- a/test/example/typeinfo.cpp
+++ b/test/example/typeinfo.cpp
@@ -15,16 +15,6 @@ void test_compound() {
assert(Type(func, NonNullable).getID() ==
Type(sameFunc, NonNullable).getID());
- HeapType extern_(HeapType::ext);
- assert(Type(extern_, Nullable).getID() == Type::externref);
- assert(Type(extern_, NonNullable).getID() ==
- Type(extern_, NonNullable).getID());
- assert(Type(extern_, NonNullable).getID() !=
- Type(extern_, Nullable).getID());
- HeapType sameExtern(HeapType::ext);
- assert(Type(extern_, NonNullable).getID() ==
- Type(sameExtern, NonNullable).getID());
-
HeapType any(HeapType::any);
assert(Type(any, Nullable).getID() == Type::anyref);
assert(Type(any, NonNullable).getID() == Type(any, NonNullable).getID());
@@ -102,7 +92,7 @@ void test_compound() {
Tuple sameTuple({Type::i32, Type::f64});
assert(Type(tuple).getID() == Type(sameTuple).getID());
- Tuple otherTuple({Type::f64, Type::externref});
+ Tuple otherTuple({Type::f64, Type::anyref});
assert(Type(tuple).getID() != Type(otherTuple).getID());
}
{
@@ -140,9 +130,6 @@ void test_printing() {
std::cout << HeapType(HeapType::func) << "\n";
std::cout << Type(HeapType::func, Nullable) << "\n";
std::cout << Type(HeapType::func, NonNullable) << "\n";
- std::cout << HeapType(HeapType::ext) << "\n";
- std::cout << Type(HeapType::ext, Nullable) << "\n";
- std::cout << Type(HeapType::ext, NonNullable) << "\n";
std::cout << HeapType(HeapType::any) << "\n";
std::cout << Type(HeapType::any, Nullable) << "\n";
std::cout << Type(HeapType::any, NonNullable) << "\n";
@@ -178,7 +165,7 @@ void test_printing() {
{Type::i64, Immutable},
{Type::f32, Mutable},
{Type::f64, Mutable},
- {Type::externref, Immutable},
+ {Type::anyref, Immutable},
});
std::cout << struct_ << "\n";
std::cout << Type(struct_, NonNullable) << "\n";
@@ -190,7 +177,7 @@ void test_printing() {
std::cout << array << "\n";
std::cout << Type(array, NonNullable) << "\n";
std::cout << Type(array, Nullable) << "\n";
- Array arrayMut({Type::externref, Mutable});
+ Array arrayMut({Type::anyref, Mutable});
std::cout << arrayMut << "\n";
std::cout << Type(arrayMut, NonNullable) << "\n";
std::cout << Type(arrayMut, Nullable) << "\n";
@@ -203,7 +190,7 @@ void test_printing() {
Tuple tuple({
Type::i32,
Type::f64,
- Type::externref,
+ Type::anyref,
});
std::cout << tuple << "\n";
std::cout << Type(tuple) << "\n";
@@ -212,8 +199,6 @@ void test_printing() {
std::cout << "\n;; Rtt\n";
std::cout << Rtt(0, HeapType::func) << "\n";
std::cout << Type(Rtt(0, HeapType::func)) << "\n";
- std::cout << Rtt(1, HeapType::ext) << "\n";
- std::cout << Type(Rtt(1, HeapType::ext)) << "\n";
std::cout << Rtt(2, HeapType::any) << "\n";
std::cout << Type(Rtt(2, HeapType::any)) << "\n";
std::cout << Rtt(3, HeapType::eq) << "\n";
diff --git a/test/example/typeinfo.txt b/test/example/typeinfo.txt
index 552e59e58..924fcb3ec 100644
--- a/test/example/typeinfo.txt
+++ b/test/example/typeinfo.txt
@@ -2,9 +2,6 @@
func
funcref
(ref func)
-extern
-externref
-(ref extern)
any
anyref
(ref any)
@@ -30,7 +27,7 @@ i31ref
(struct)
(ref $struct.0)
(ref null $struct.0)
-(struct (field i32 i64 (mut f32) (mut f64) externref))
+(struct (field i32 i64 (mut f32) (mut f64) anyref))
(ref $struct.0)
(ref null $struct.0)
@@ -38,21 +35,19 @@ i31ref
(array i32)
(ref $array.0)
(ref null $array.0)
-(array (mut externref))
+(array (mut anyref))
(ref $array.0)
(ref null $array.0)
;; Tuple
()
none
-(i32 f64 externref)
-(i32 f64 externref)
+(i32 f64 anyref)
+(i32 f64 anyref)
;; Rtt
(rtt 0 func)
(rtt 0 func)
-(rtt 1 extern)
-(rtt 1 extern)
(rtt 2 any)
(rtt 2 any)
(rtt 3 eq)