summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt18
-rw-r--r--test/ctor-eval/bad-indirect-call3.wast.out4
-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
-rw-r--r--test/gtest/type-builder.cpp22
-rw-r--r--test/lit/fuzz-types/isorecursive.test36
-rw-r--r--test/lit/fuzz-types/nominal.test28
-rw-r--r--test/lit/fuzz-types/structural.test30
-rw-r--r--test/lit/passes/flatten_all-features.wast40
-rw-r--r--test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast20
-rw-r--r--test/lit/passes/optimize-instructions-gc.wast8
-rw-r--r--test/multi-table.wast.from-wast2
-rw-r--r--test/multi-table.wast.fromBinary2
-rw-r--r--test/multi-table.wast.fromBinary.noDebugInfo2
-rw-r--r--test/multivalue.wast.from-wast10
-rw-r--r--test/multivalue.wast.fromBinary12
-rw-r--r--test/multivalue.wast.fromBinary.noDebugInfo12
-rw-r--r--test/passes/precompute_all-features.txt12
-rw-r--r--test/passes/simplify-globals_all-features.txt8
-rw-r--r--test/passes/simplify-locals_all-features.txt2
-rw-r--r--test/passes/strip-target-features_roundtrip_print-features_all-features.txt8
-rw-r--r--test/passes/translate-to-fuzz_all-features_metrics_noprint.txt71
-rw-r--r--test/reference-types.wast.from-wast100
-rw-r--r--test/reference-types.wast.fromBinary98
-rw-r--r--test/reference-types.wast.fromBinary.noDebugInfo180
-rw-r--r--test/unit/input/gc_target_feature.wasmbin94 -> 94 bytes
-rw-r--r--test/unit/test_features.py10
32 files changed, 380 insertions, 425 deletions
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 3ea3f11a9..70be70e61 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -16,14 +16,14 @@
// 7
// BinaryenTypeExternref: 8
// 8
- // BinaryenTypeAnyref: 9
+ // BinaryenTypeAnyref: 8
+ // 8
+ // BinaryenTypeEqref: 9
// 9
- // BinaryenTypeEqref: 10
+ // BinaryenTypeI31ref: 10
// 10
- // BinaryenTypeI31ref: 11
+ // BinaryenTypeDataref: 11
// 11
- // BinaryenTypeDataref: 12
- // 12
// BinaryenTypeAuto: -1
// 2,2
// 2,2
@@ -2070,7 +2070,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
(drop
(ref.is_null
- (ref.null extern)
+ (ref.null any)
)
)
(drop
@@ -2165,7 +2165,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(pop funcref)
)
(drop
- (pop externref)
+ (pop anyref)
)
(drop
(pop anyref)
@@ -4162,7 +4162,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
(drop
(ref.is_null
- (ref.null extern)
+ (ref.null any)
)
)
(drop
@@ -4257,7 +4257,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(pop funcref)
)
(drop
- (pop externref)
+ (pop anyref)
)
(drop
(pop anyref)
diff --git a/test/ctor-eval/bad-indirect-call3.wast.out b/test/ctor-eval/bad-indirect-call3.wast.out
index 4b470e10a..257bf3168 100644
--- a/test/ctor-eval/bad-indirect-call3.wast.out
+++ b/test/ctor-eval/bad-indirect-call3.wast.out
@@ -1,5 +1,5 @@
(module
- (type $externref_=>_none (func (param externref)))
+ (type $anyref_=>_none (func (param anyref)))
(type $none_=>_none (func))
(type $funcref_=>_none (func (param funcref)))
(memory $0 256 256)
@@ -7,7 +7,7 @@
(table $0 1 1 funcref)
(elem (i32.const 0) $callee)
(export "sig_mismatch" (func $sig_mismatch))
- (func $callee (param $0 externref)
+ (func $callee (param $0 anyref)
(i32.store8
(i32.const 40)
(i32.const 67)
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)
diff --git a/test/gtest/type-builder.cpp b/test/gtest/type-builder.cpp
index 7817939ce..42b388532 100644
--- a/test/gtest/type-builder.cpp
+++ b/test/gtest/type-builder.cpp
@@ -118,7 +118,7 @@ TEST_F(TypeTest, IndexedTypePrinter) {
TEST_F(EquirecursiveTest, Basics) {
// (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(3);
ASSERT_EQ(builder.size(), size_t{3});
@@ -127,11 +127,11 @@ TEST_F(EquirecursiveTest, Basics) {
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));
builder[0] = sig;
builder[1] = struct_;
@@ -159,7 +159,7 @@ TEST_F(EquirecursiveTest, Basics) {
EXPECT_EQ(
built[1].getStruct(),
Struct({Field(newRefNullArray, Immutable), Field(newRttArray, Mutable)}));
- EXPECT_EQ(built[2].getArray(), Array(Field(refNullExt, Mutable)));
+ EXPECT_EQ(built[2].getArray(), Array(Field(refNullAny, Mutable)));
// The built types should be different from the temporary types.
EXPECT_NE(newRefSig, refSig);
@@ -475,14 +475,14 @@ TEST_F(IsorecursiveTest, CanonicalizeTypesBeforeSubtyping) {
static void testCanonicalizeBasicTypes() {
TypeBuilder builder(5);
- Type externref = builder.getTempRefType(builder[0], Nullable);
- Type externrefs = builder.getTempTupleType({externref, externref});
+ Type anyref = builder.getTempRefType(builder[0], Nullable);
+ Type anyrefs = builder.getTempTupleType({anyref, anyref});
- builder[0] = HeapType::ext;
- builder[1] = Struct({Field(externref, Immutable)});
- builder[2] = Struct({Field(Type::externref, Immutable)});
- builder[3] = Signature(externrefs, Type::none);
- builder[4] = Signature({Type::externref, Type::externref}, Type::none);
+ builder[0] = HeapType::any;
+ builder[1] = Struct({Field(anyref, Immutable)});
+ builder[2] = Struct({Field(Type::anyref, Immutable)});
+ builder[3] = Signature(anyrefs, Type::none);
+ builder[4] = Signature({Type::anyref, Type::anyref}, Type::none);
auto result = builder.build();
ASSERT_TRUE(result);
diff --git a/test/lit/fuzz-types/isorecursive.test b/test/lit/fuzz-types/isorecursive.test
index 33b7974b3..9165d9265 100644
--- a/test/lit/fuzz-types/isorecursive.test
+++ b/test/lit/fuzz-types/isorecursive.test
@@ -2,25 +2,25 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $0 (struct_subtype data))
-;; CHECK-NEXT: (type $1 (func_subtype (param i31ref) (result (ref extern)) func))
-;; CHECK-NEXT: (type $2 (array_subtype (mut (rtt 0 extern)) data))
-;; CHECK-NEXT: (type $3 (array_subtype (mut (rtt 0 extern)) $2))
-;; CHECK-NEXT: (type $4 (array_subtype (mut (rtt 0 extern)) $2))
-;; CHECK-NEXT: (type $5 (array_subtype (mut (rtt 0 extern)) $3))
-;; CHECK-NEXT: (type $6 (array_subtype (mut (rtt 0 extern)) $3))
-;; CHECK-NEXT: (type $7 (struct_subtype (field (mut (ref $8))) $0))
-;; CHECK-NEXT: (type $8 (struct_subtype (field i16 (mut i32) (mut i16)) $0))
-;; CHECK-NEXT: (type $9 (array_subtype (mut (rtt 0 extern)) $6))
+;; CHECK-NEXT: (type $1 (func_subtype (param i31ref) (result dataref) func))
+;; CHECK-NEXT: (type $2 (array_subtype i32 data))
+;; CHECK-NEXT: (type $3 (array_subtype i32 $2))
+;; CHECK-NEXT: (type $4 (array_subtype i32 $2))
+;; CHECK-NEXT: (type $5 (array_subtype i32 $3))
+;; CHECK-NEXT: (type $6 (array_subtype i32 $3))
+;; CHECK-NEXT: (type $7 (struct_subtype $0))
+;; CHECK-NEXT: (type $8 (struct_subtype $0))
+;; CHECK-NEXT: (type $9 (array_subtype i32 $6))
;; CHECK-NEXT: (type $10 (struct_subtype $0))
-;; CHECK-NEXT: (type $11 (array_subtype (mut (rtt 0 extern)) $2))
-;; CHECK-NEXT: (type $12 (struct_subtype (field (mut i8) (rtt $0)) $0))
-;; CHECK-NEXT: (type $13 (array_subtype (mut (rtt 0 extern)) $6))
+;; CHECK-NEXT: (type $11 (array_subtype i32 $2))
+;; CHECK-NEXT: (type $12 (struct_subtype $0))
+;; CHECK-NEXT: (type $13 (array_subtype i32 $6))
;; CHECK-NEXT: )
;; CHECK-NEXT: (rec
-;; CHECK-NEXT: (type $14 (struct_subtype (field funcref f64 (mut (rtt $10)) (ref null $15) i8 (ref null $7)) $10))
-;; CHECK-NEXT: (type $15 (func_subtype (param i31ref) (result (ref extern)) $1))
-;; CHECK-NEXT: (type $16 (array_subtype (mut (rtt 0 extern)) $2))
-;; CHECK-NEXT: (type $17 (struct_subtype (field funcref f64 (mut (rtt $10)) (ref null $15) i8 (ref null $7)) $14))
-;; CHECK-NEXT: (type $18 (struct_subtype (field (mut i8) (rtt $0)) $12))
-;; CHECK-NEXT: (type $19 (func_subtype (param i31ref) (result (ref extern)) $15))
+;; CHECK-NEXT: (type $14 (struct_subtype $10))
+;; CHECK-NEXT: (type $15 (func_subtype (param i31ref) (result dataref) $1))
+;; CHECK-NEXT: (type $16 (array_subtype i32 $2))
+;; CHECK-NEXT: (type $17 (struct_subtype $14))
+;; CHECK-NEXT: (type $18 (struct_subtype (field (mut funcref) (mut (ref null $7)) funcref) $12))
+;; CHECK-NEXT: (type $19 (func_subtype (param i31ref) (result dataref) $15))
;; CHECK-NEXT: )
diff --git a/test/lit/fuzz-types/nominal.test b/test/lit/fuzz-types/nominal.test
index 8ca330adf..248ce6539 100644
--- a/test/lit/fuzz-types/nominal.test
+++ b/test/lit/fuzz-types/nominal.test
@@ -1,24 +1,22 @@
;; RUN: wasm-fuzz-types --nominal -v --seed=0 | filecheck %s
-;; CHECK: Running with seed 0
-;; CHECK-NEXT: Built 20 types:
-;; CHECK-NEXT: (type $0 (struct_subtype (field (ref null $9) (ref $5)) data))
+;; CHECK: (type $0 (struct_subtype (field (ref null $9) (ref $5)) data))
;; CHECK-NEXT: (type $1 (func_subtype (param (rtt 0 $8)) func))
;; CHECK-NEXT: (type $2 (struct_subtype (field (mut (rtt $19)) (ref $4)) data))
-;; CHECK-NEXT: (type $3 (struct_subtype (field (mut (rtt $19)) (ref $4) i32 (mut (ref null $2)) (mut f64)) $2))
-;; CHECK-NEXT: (type $4 (struct_subtype (field (mut (rtt $19)) (ref $4)) $2))
-;; CHECK-NEXT: (type $5 (struct_subtype (field (mut (rtt $19)) (ref $4) i32 (mut (ref null $2)) (mut f64) (mut (ref null $11))) $3))
-;; CHECK-NEXT: (type $6 (struct_subtype (field (mut (rtt $19)) (ref $4) i32 (mut (ref null $2)) (mut f64)) $3))
-;; CHECK-NEXT: (type $7 (struct_subtype (field (ref null $9) (ref $5)) $0))
-;; CHECK-NEXT: (type $8 (struct_subtype (field (ref null $9) (ref $5)) $0))
-;; CHECK-NEXT: (type $9 (struct_subtype (field (mut (rtt $19)) (ref $4) i32 (mut (ref null $2)) (mut f64)) $6))
-;; CHECK-NEXT: (type $10 (struct_subtype (field (ref $9) (ref $5) (mut i31ref)) $0))
+;; CHECK-NEXT: (type $3 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 (mut (ref null $2)) (mut i64)) $2))
+;; CHECK-NEXT: (type $4 (struct_subtype (field (mut (rtt $19)) (ref $4) (mut (ref $13))) $2))
+;; CHECK-NEXT: (type $5 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 (mut (ref null $2)) (mut i64)) $3))
+;; CHECK-NEXT: (type $6 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 (mut (ref null $2)) (mut i64)) $3))
+;; CHECK-NEXT: (type $7 (struct_subtype (field (ref null $9) (ref $5) eqref (mut (ref null $3)) (mut (rtt $18)) dataref) $0))
+;; CHECK-NEXT: (type $8 (struct_subtype (field (ref $9) (ref $5) (rtt 2 $1) (mut (rtt $17)) (mut (rtt i31)) (rtt $8)) $0))
+;; CHECK-NEXT: (type $9 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 (mut (ref null $2)) (mut i64) (rtt 2 $15)) $6))
+;; CHECK-NEXT: (type $10 (struct_subtype (field (ref null $9) (ref $5)) $0))
;; CHECK-NEXT: (type $11 (struct_subtype (field (mut (rtt $19)) (ref $4)) $2))
;; CHECK-NEXT: (type $12 (struct_subtype (field (ref null $9) (ref $5)) $0))
-;; CHECK-NEXT: (type $13 (struct_subtype (field (mut (rtt $19)) (ref $4) i32 (mut (ref null $2)) (mut f64) (ref null i31)) $6))
-;; CHECK-NEXT: (type $14 (struct_subtype (field (ref $9) (ref $5) (mut i31ref) i8) $10))
+;; CHECK-NEXT: (type $13 (struct_subtype (field (mut (rtt $19)) (ref $4) i64 (mut (ref null $2)) (mut i64)) $6))
+;; CHECK-NEXT: (type $14 (struct_subtype (field (ref null $9) (ref $5)) $10))
;; CHECK-NEXT: (type $15 (func_subtype (param (rtt 0 $8)) $1))
-;; CHECK-NEXT: (type $16 (struct_subtype (field (mut (rtt $19)) (ref $4)) $2))
-;; CHECK-NEXT: (type $17 (struct_subtype (field (ref $9) (ref $5) (mut i31ref) i8 (mut dataref) (mut i16)) $14))
+;; CHECK-NEXT: (type $16 (struct_subtype (field (mut (rtt $19)) (ref $4) v128) $2))
+;; CHECK-NEXT: (type $17 (struct_subtype (field (ref null $9) (ref $5)) $14))
;; CHECK-NEXT: (type $18 (struct_subtype (field (ref null $9) (ref $5)) $12))
;; CHECK-NEXT: (type $19 (func_subtype (param (rtt 0 $8)) $15))
diff --git a/test/lit/fuzz-types/structural.test b/test/lit/fuzz-types/structural.test
index 0d81491af..a7b38edb4 100644
--- a/test/lit/fuzz-types/structural.test
+++ b/test/lit/fuzz-types/structural.test
@@ -1,24 +1,22 @@
;; RUN: wasm-fuzz-types --structural -v --seed=0 | filecheck %s
-;; CHECK: Running with seed 0
-;; CHECK-NEXT: Built 20 types:
-;; CHECK-NEXT: (type $0 (struct (field (ref null $3) (ref $5))))
-;; CHECK-NEXT: (type $1 (func (param (rtt 0 $0))))
-;; CHECK-NEXT: (type $2 (struct (field (mut (rtt $1)) (ref $2))))
-;; CHECK-NEXT: (type $3 (struct (field (mut (rtt $1)) (ref $2) i32 (mut (ref null $2)) (mut f64))))
-;; CHECK-NEXT: (type $4 identical to $2)
-;; CHECK-NEXT: (type $5 (struct (field (mut (rtt $1)) (ref $2) i32 (mut (ref null $2)) (mut f64) (mut (ref null $2)))))
+;; CHECK: (type $0 (struct (field (ref null $9) (ref $3))))
+;; CHECK-NEXT: (type $1 (func (param (rtt 0 $8))))
+;; CHECK-NEXT: (type $2 (struct (field (mut (rtt $1)) (ref $4))))
+;; CHECK-NEXT: (type $3 (struct (field (mut (rtt $1)) (ref $4) i64 (mut (ref null $2)) (mut i64))))
+;; CHECK-NEXT: (type $4 (struct (field (mut (rtt $1)) (ref $4) (mut (ref $3)))))
+;; CHECK-NEXT: (type $5 identical to $3)
;; CHECK-NEXT: (type $6 identical to $3)
-;; CHECK-NEXT: (type $7 identical to $0)
-;; CHECK-NEXT: (type $8 identical to $0)
-;; CHECK-NEXT: (type $9 identical to $3)
-;; CHECK-NEXT: (type $10 (struct (field (ref $3) (ref $5) (mut i31ref))))
+;; CHECK-NEXT: (type $7 (struct (field (ref null $9) (ref $3) eqref (mut (ref null $3)) (mut (rtt $0)) dataref)))
+;; CHECK-NEXT: (type $8 (struct (field (ref $9) (ref $3) (rtt 2 $1) (mut (rtt $0)) (mut (rtt i31)) (rtt $8))))
+;; CHECK-NEXT: (type $9 (struct (field (mut (rtt $1)) (ref $4) i64 (mut (ref null $2)) (mut i64) (rtt 2 $1))))
+;; CHECK-NEXT: (type $10 identical to $0)
;; CHECK-NEXT: (type $11 identical to $2)
;; CHECK-NEXT: (type $12 identical to $0)
-;; CHECK-NEXT: (type $13 (struct (field (mut (rtt $1)) (ref $2) i32 (mut (ref null $2)) (mut f64) (ref null i31))))
-;; CHECK-NEXT: (type $14 (struct (field (ref $3) (ref $5) (mut i31ref) i8)))
+;; CHECK-NEXT: (type $13 identical to $3)
+;; CHECK-NEXT: (type $14 identical to $0)
;; CHECK-NEXT: (type $15 identical to $1)
-;; CHECK-NEXT: (type $16 identical to $2)
-;; CHECK-NEXT: (type $17 (struct (field (ref $3) (ref $5) (mut i31ref) i8 (mut dataref) (mut i16))))
+;; CHECK-NEXT: (type $16 (struct (field (mut (rtt $1)) (ref $4) v128)))
+;; CHECK-NEXT: (type $17 identical to $0)
;; CHECK-NEXT: (type $18 identical to $0)
;; CHECK-NEXT: (type $19 identical to $1)
diff --git a/test/lit/passes/flatten_all-features.wast b/test/lit/passes/flatten_all-features.wast
index 5e8cfe25c..cafd78a04 100644
--- a/test/lit/passes/flatten_all-features.wast
+++ b/test/lit/passes/flatten_all-features.wast
@@ -3416,50 +3416,46 @@
;; value type, we need the value to be set into two locals: one with the outer
;; block's type, and one with its value type.
;; CHECK: (func $subtype (result anyref)
- ;; CHECK-NEXT: (local $0 externref)
+ ;; CHECK-NEXT: (local $0 anyref)
;; CHECK-NEXT: (local $1 anyref)
- ;; CHECK-NEXT: (local $2 externref)
- ;; CHECK-NEXT: (local $3 externref)
- ;; CHECK-NEXT: (local $4 externref)
- ;; CHECK-NEXT: (local $5 externref)
- ;; CHECK-NEXT: (local $6 externref)
- ;; CHECK-NEXT: (local $7 anyref)
+ ;; CHECK-NEXT: (local $2 anyref)
+ ;; CHECK-NEXT: (local $3 anyref)
+ ;; CHECK-NEXT: (local $4 anyref)
+ ;; CHECK-NEXT: (local $5 anyref)
+ ;; CHECK-NEXT: (local $6 anyref)
;; CHECK-NEXT: (block $label0
;; CHECK-NEXT: (block $block
;; CHECK-NEXT: (local.set $1
- ;; CHECK-NEXT: (ref.null extern)
- ;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $2
- ;; CHECK-NEXT: (ref.null extern)
+ ;; CHECK-NEXT: (ref.null any)
;; CHECK-NEXT: )
;; CHECK-NEXT: (br_if $label0
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $3
- ;; CHECK-NEXT: (local.get $2)
+ ;; CHECK-NEXT: (local.set $2
+ ;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $0
- ;; CHECK-NEXT: (local.get $3)
+ ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $4
+ ;; CHECK-NEXT: (local.set $3
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $5
- ;; CHECK-NEXT: (local.get $4)
+ ;; CHECK-NEXT: (local.set $4
+ ;; CHECK-NEXT: (local.get $3)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $6
- ;; CHECK-NEXT: (local.get $5)
+ ;; CHECK-NEXT: (local.set $5
+ ;; CHECK-NEXT: (local.get $4)
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $1
- ;; CHECK-NEXT: (local.get $6)
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $7
+ ;; CHECK-NEXT: (local.set $6
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (return
- ;; CHECK-NEXT: (local.get $7)
+ ;; CHECK-NEXT: (local.get $6)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $subtype (result anyref)
diff --git a/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast b/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast
index 8b971cdb8..e736253f6 100644
--- a/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast
+++ b/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast
@@ -14,8 +14,6 @@
;; CHECK: (type $i32_i32_funcref_=>_funcref (func (param i32 i32 funcref) (result funcref)))
- ;; CHECK: (type $i32_i32_externref_=>_externref (func (param i32 i32 externref) (result externref)))
-
;; CHECK: (type $i32_i32_anyref_=>_anyref (func (param i32 i32 anyref) (result anyref)))
;; CHECK: (type $i32_i32_eqref_=>_eqref (func (param i32 i32 eqref) (result eqref)))
@@ -48,10 +46,6 @@
;; CHECK: (import "env" "set_funcref" (func $set_funcref (param i32 i32 funcref) (result funcref)))
- ;; CHECK: (import "env" "get_externref" (func $get_externref (param i32 i32 externref) (result externref)))
-
- ;; CHECK: (import "env" "set_externref" (func $set_externref (param i32 i32 externref) (result externref)))
-
;; CHECK: (import "env" "get_anyref" (func $get_anyref (param i32 i32 anyref) (result anyref)))
;; CHECK: (import "env" "set_anyref" (func $set_anyref (param i32 i32 anyref) (result anyref)))
@@ -80,7 +74,7 @@
;; CHECK-NEXT: (local $z f32)
;; CHECK-NEXT: (local $w f64)
;; CHECK-NEXT: (local $F funcref)
- ;; CHECK-NEXT: (local $X externref)
+ ;; CHECK-NEXT: (local $X anyref)
;; CHECK-NEXT: (local $S v128)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (call $get_i32
@@ -114,7 +108,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (call $get_externref
+ ;; CHECK-NEXT: (call $get_anyref
;; CHECK-NEXT: (i32.const 4)
;; CHECK-NEXT: (i32.const 5)
;; CHECK-NEXT: (local.get $X)
@@ -152,7 +146,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (call $get_externref
+ ;; CHECK-NEXT: (call $get_anyref
;; CHECK-NEXT: (i32.const 9)
;; CHECK-NEXT: (i32.const 5)
;; CHECK-NEXT: (local.get $X)
@@ -186,10 +180,10 @@
;; CHECK-NEXT: (ref.func $test)
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $X
- ;; CHECK-NEXT: (call $set_externref
+ ;; CHECK-NEXT: (call $set_anyref
;; CHECK-NEXT: (i32.const 14)
;; CHECK-NEXT: (i32.const 5)
- ;; CHECK-NEXT: (call $get_externref
+ ;; CHECK-NEXT: (call $get_anyref
;; CHECK-NEXT: (i32.const 13)
;; CHECK-NEXT: (i32.const 5)
;; CHECK-NEXT: (local.get $X)
@@ -232,10 +226,10 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $X
- ;; CHECK-NEXT: (call $set_externref
+ ;; CHECK-NEXT: (call $set_anyref
;; CHECK-NEXT: (i32.const 21)
;; CHECK-NEXT: (i32.const 5)
- ;; CHECK-NEXT: (call $get_externref
+ ;; CHECK-NEXT: (call $get_anyref
;; CHECK-NEXT: (i32.const 20)
;; CHECK-NEXT: (i32.const 5)
;; CHECK-NEXT: (local.get $X)
diff --git a/test/lit/passes/optimize-instructions-gc.wast b/test/lit/passes/optimize-instructions-gc.wast
index 5f2c25c5d..64213d930 100644
--- a/test/lit/passes/optimize-instructions-gc.wast
+++ b/test/lit/passes/optimize-instructions-gc.wast
@@ -47,10 +47,10 @@
;; These functions test if an `if` with subtyped arms is correctly folded
;; 1. if its `ifTrue` and `ifFalse` arms are identical (can fold)
;; CHECK: (func $if-arms-subtype-fold (result anyref)
- ;; CHECK-NEXT: (ref.null extern)
+ ;; CHECK-NEXT: (ref.null any)
;; CHECK-NEXT: )
;; NOMNL: (func $if-arms-subtype-fold (type $none_=>_anyref) (result anyref)
- ;; NOMNL-NEXT: (ref.null extern)
+ ;; NOMNL-NEXT: (ref.null any)
;; NOMNL-NEXT: )
(func $if-arms-subtype-fold (result anyref)
(if (result anyref)
@@ -63,14 +63,14 @@
;; CHECK: (func $if-arms-subtype-nofold (result anyref)
;; CHECK-NEXT: (if (result anyref)
;; CHECK-NEXT: (i32.const 0)
- ;; CHECK-NEXT: (ref.null extern)
+ ;; CHECK-NEXT: (ref.null any)
;; CHECK-NEXT: (ref.null func)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; NOMNL: (func $if-arms-subtype-nofold (type $none_=>_anyref) (result anyref)
;; NOMNL-NEXT: (if (result anyref)
;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: (ref.null extern)
+ ;; NOMNL-NEXT: (ref.null any)
;; NOMNL-NEXT: (ref.null func)
;; NOMNL-NEXT: )
;; NOMNL-NEXT: )
diff --git a/test/multi-table.wast.from-wast b/test/multi-table.wast.from-wast
index 73a9abea3..545bb9c56 100644
--- a/test/multi-table.wast.from-wast
+++ b/test/multi-table.wast.from-wast
@@ -5,7 +5,7 @@
(global $g2 i32 (i32.const 0))
(table $t2 3 3 funcref)
(table $t3 4 4 funcref)
- (table $textern 0 externref)
+ (table $textern 0 anyref)
(table $tspecial 5 5 (ref null $none_=>_none))
(elem $0 (table $t1) (i32.const 0) func $f)
(elem $1 (table $t2) (i32.const 0) func $f)
diff --git a/test/multi-table.wast.fromBinary b/test/multi-table.wast.fromBinary
index 427fb44f3..105706621 100644
--- a/test/multi-table.wast.fromBinary
+++ b/test/multi-table.wast.fromBinary
@@ -5,7 +5,7 @@
(global $g2 i32 (i32.const 0))
(table $t2 3 3 funcref)
(table $t3 4 4 funcref)
- (table $textern 0 externref)
+ (table $textern 0 anyref)
(table $tspecial 5 5 (ref null $none_=>_none))
(elem $0 (table $t1) (i32.const 0) func $f)
(elem $1 (table $t2) (i32.const 0) func $f)
diff --git a/test/multi-table.wast.fromBinary.noDebugInfo b/test/multi-table.wast.fromBinary.noDebugInfo
index 7fc667087..174d2a912 100644
--- a/test/multi-table.wast.fromBinary.noDebugInfo
+++ b/test/multi-table.wast.fromBinary.noDebugInfo
@@ -5,7 +5,7 @@
(global $global$1 i32 (i32.const 0))
(table $0 3 3 funcref)
(table $1 4 4 funcref)
- (table $2 0 externref)
+ (table $2 0 anyref)
(table $3 5 5 (ref null $none_=>_none))
(elem $0 (table $timport$0) (i32.const 0) func $0)
(elem $1 (table $0) (i32.const 0) func $0)
diff --git a/test/multivalue.wast.from-wast b/test/multivalue.wast.from-wast
index 9340c183a..c6aa020dd 100644
--- a/test/multivalue.wast.from-wast
+++ b/test/multivalue.wast.from-wast
@@ -3,7 +3,7 @@
(type $none_=>_none (func))
(type $none_=>_i64 (func (result i64)))
(type $none_=>_f32_i64_i32 (func (result f32 i64 i32)))
- (type $none_=>_i32_i64_externref (func (result i32 i64 externref)))
+ (type $none_=>_i32_i64_anyref (func (result i32 i64 anyref)))
(type $none_=>_i32_i64_f32 (func (result i32 i64 f32)))
(type $none_=>_i32 (func (result i32)))
(type $none_=>_f32 (func (result f32)))
@@ -135,18 +135,18 @@
)
)
)
- (func $mv-if (result i32 i64 externref)
- (if (result i32 i64 externref)
+ (func $mv-if (result i32 i64 anyref)
+ (if (result i32 i64 anyref)
(i32.const 1)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null extern)
+ (ref.null any)
)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null extern)
+ (ref.null any)
)
)
)
diff --git a/test/multivalue.wast.fromBinary b/test/multivalue.wast.fromBinary
index dd39d4b34..cc900e024 100644
--- a/test/multivalue.wast.fromBinary
+++ b/test/multivalue.wast.fromBinary
@@ -1,7 +1,7 @@
(module
(type $none_=>_i32_i64 (func (result i32 i64)))
(type $none_=>_none (func))
- (type $none_=>_i32_i64_externref (func (result i32 i64 externref)))
+ (type $none_=>_i32_i64_anyref (func (result i32 i64 anyref)))
(type $none_=>_i64 (func (result i64)))
(type $none_=>_f32_i64_i32 (func (result f32 i64 i32)))
(type $none_=>_i32_i64_f32 (func (result i32 i64 f32)))
@@ -389,20 +389,20 @@
)
)
)
- (func $mv-if (result i32 i64 externref)
- (local $0 (i32 i64 externref))
+ (func $mv-if (result i32 i64 anyref)
+ (local $0 (i32 i64 anyref))
(local.set $0
- (if (result i32 i64 externref)
+ (if (result i32 i64 anyref)
(i32.const 1)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null extern)
+ (ref.null any)
)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null extern)
+ (ref.null any)
)
)
)
diff --git a/test/multivalue.wast.fromBinary.noDebugInfo b/test/multivalue.wast.fromBinary.noDebugInfo
index 66c0f52c5..daf0a743e 100644
--- a/test/multivalue.wast.fromBinary.noDebugInfo
+++ b/test/multivalue.wast.fromBinary.noDebugInfo
@@ -1,7 +1,7 @@
(module
(type $none_=>_i32_i64 (func (result i32 i64)))
(type $none_=>_none (func))
- (type $none_=>_i32_i64_externref (func (result i32 i64 externref)))
+ (type $none_=>_i32_i64_anyref (func (result i32 i64 anyref)))
(type $none_=>_i64 (func (result i64)))
(type $none_=>_f32_i64_i32 (func (result f32 i64 i32)))
(type $none_=>_i32_i64_f32 (func (result i32 i64 f32)))
@@ -389,20 +389,20 @@
)
)
)
- (func $14 (result i32 i64 externref)
- (local $0 (i32 i64 externref))
+ (func $14 (result i32 i64 anyref)
+ (local $0 (i32 i64 anyref))
(local.set $0
- (if (result i32 i64 externref)
+ (if (result i32 i64 anyref)
(i32.const 1)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null extern)
+ (ref.null any)
)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null extern)
+ (ref.null any)
)
)
)
diff --git a/test/passes/precompute_all-features.txt b/test/passes/precompute_all-features.txt
index 89d334a93..70c790484 100644
--- a/test/passes/precompute_all-features.txt
+++ b/test/passes/precompute_all-features.txt
@@ -5,7 +5,7 @@
(type $0 (func (param i32)))
(type $none_=>_v128 (func (result v128)))
(type $none_=>_i32_i64 (func (result i32 i64)))
- (type $none_=>_externref (func (result externref)))
+ (type $none_=>_anyref (func (result anyref)))
(global $global i32 (i32.const 1))
(global $global-mut (mut i32) (i32.const 2))
(memory $0 512 512)
@@ -253,8 +253,8 @@
(func $loop-precompute (result i32)
(i32.const 1)
)
- (func $reftype-test (result externref)
- (ref.null extern)
+ (func $reftype-test (result anyref)
+ (ref.null any)
)
(func $dummy
(nop)
@@ -276,18 +276,18 @@
)
)
(drop
- (block $l2 (result externref)
+ (block $l2 (result anyref)
(drop
(block $l3
(global.set $global-mut
(i32.const 1)
)
(br $l2
- (ref.null extern)
+ (ref.null any)
)
)
)
- (ref.null extern)
+ (ref.null any)
)
)
(drop
diff --git a/test/passes/simplify-globals_all-features.txt b/test/passes/simplify-globals_all-features.txt
index ace056aac..5ad54b0a8 100644
--- a/test/passes/simplify-globals_all-features.txt
+++ b/test/passes/simplify-globals_all-features.txt
@@ -213,9 +213,9 @@
)
(module
(type $none_=>_none (func))
- (import "env" "global-1" (global $g1 externref))
- (global $g2 externref (global.get $g1))
- (global $g3 externref (ref.null extern))
+ (import "env" "global-1" (global $g1 anyref))
+ (global $g2 anyref (global.get $g1))
+ (global $g3 anyref (ref.null any))
(func $test1
(drop
(global.get $g1)
@@ -226,7 +226,7 @@
)
(func $test2
(drop
- (ref.null extern)
+ (ref.null any)
)
)
)
diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt
index de387c27b..0c25ea54b 100644
--- a/test/passes/simplify-locals_all-features.txt
+++ b/test/passes/simplify-locals_all-features.txt
@@ -1884,7 +1884,7 @@
(module
(type $none_=>_anyref (func (result anyref)))
(func $subtype-test (result anyref)
- (local $0 externref)
+ (local $0 anyref)
(local $1 anyref)
(local $2 anyref)
(block $block
diff --git a/test/passes/strip-target-features_roundtrip_print-features_all-features.txt b/test/passes/strip-target-features_roundtrip_print-features_all-features.txt
index 53fd2b237..e93805cf5 100644
--- a/test/passes/strip-target-features_roundtrip_print-features_all-features.txt
+++ b/test/passes/strip-target-features_roundtrip_print-features_all-features.txt
@@ -14,14 +14,14 @@
--enable-relaxed-simd
--enable-extended-const
(module
- (type $none_=>_v128_externref (func (result v128 externref)))
- (func $foo (result v128 externref)
+ (type $none_=>_v128_anyref (func (result v128 anyref)))
+ (func $foo (result v128 anyref)
(tuple.make
(v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)
- (ref.null extern)
+ (ref.null any)
)
)
- (func $bar (result v128 externref)
+ (func $bar (result v128 anyref)
(return_call $foo)
)
)
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 a172095ef..f264b4e63 100644
--- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
+++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
@@ -1,46 +1,43 @@
total
- [exports] : 13
- [funcs] : 18
+ [exports] : 3
+ [funcs] : 3
[globals] : 6
[imports] : 5
[memory-data] : 22
- [table-data] : 14
+ [table-data] : 0
[tables] : 1
[tags] : 1
- [total] : 728
- [vars] : 41
- ArrayInit : 6
- AtomicFence : 1
- AtomicNotify : 1
- AtomicRMW : 1
- Binary : 80
- Block : 83
- Break : 13
- Call : 33
- CallIndirect : 1
- CallRef : 1
- Const : 162
- Drop : 10
- GlobalGet : 50
- GlobalSet : 27
- I31Get : 3
- I31New : 5
- If : 32
- Load : 20
- LocalGet : 35
- LocalSet : 21
- Loop : 8
+ [total] : 813
+ [vars] : 2
+ ArrayInit : 1
+ AtomicFence : 2
+ Binary : 96
+ Block : 104
+ Break : 25
+ Call : 25
+ CallRef : 4
+ Const : 173
+ Drop : 1
+ GlobalGet : 54
+ GlobalSet : 28
+ I31New : 4
+ If : 38
+ Load : 23
+ LocalGet : 56
+ LocalSet : 39
+ Loop : 24
MemoryFill : 1
MemoryInit : 1
- Nop : 14
- RefAs : 1
- RefFunc : 16
- RefIs : 2
- RefNull : 6
- Return : 27
- SIMDExtract : 1
- Select : 8
- Store : 2
- StructNew : 7
+ Nop : 8
+ RefEq : 1
+ RefFunc : 6
+ RefIs : 3
+ RefNull : 2
+ Return : 26
+ SIMDExtract : 6
+ Select : 2
+ Store : 5
+ StructNew : 2
+ TupleExtract : 5
TupleMake : 5
- Unary : 44
+ Unary : 43
diff --git a/test/reference-types.wast.from-wast b/test/reference-types.wast.from-wast
index d6f0ca7d0..5afb74eda 100644
--- a/test/reference-types.wast.from-wast
+++ b/test/reference-types.wast.from-wast
@@ -3,18 +3,16 @@
(type $sig_anyref (func (param anyref)))
(type $sig_funcref (func (param funcref)))
(type $none_=>_funcref (func (result funcref)))
- (type $sig_externref (func (param externref)))
(type $none_=>_none (func))
- (type $none_=>_externref (func (result externref)))
(type $i32_=>_none (func (param i32)))
- (type $externref_=>_funcref (func (param externref) (result funcref)))
- (import "env" "import_global" (global $import_global externref))
- (import "env" "import_func" (func $import_func (param externref) (result funcref)))
- (global $global_externref (mut externref) (ref.null extern))
+ (type $anyref_=>_funcref (func (param anyref) (result funcref)))
+ (import "env" "import_global" (global $import_global anyref))
+ (import "env" "import_func" (func $import_func (param anyref) (result funcref)))
+ (global $global_externref (mut anyref) (ref.null any))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
(global $global_anyref (mut anyref) (ref.null any))
- (global $global_anyref2 (mut anyref) (ref.null extern))
+ (global $global_anyref2 (mut anyref) (ref.null any))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
(table $0 3 3 funcref)
@@ -23,7 +21,7 @@
(tag $e-i32 (param i32))
(export "export_func" (func $import_func))
(export "export_global" (global $import_global))
- (func $take_externref (param $0 externref)
+ (func $take_externref (param $0 anyref)
(nop)
)
(func $take_funcref (param $0 funcref)
@@ -36,7 +34,7 @@
(nop)
)
(func $test
- (local $local_externref externref)
+ (local $local_externref anyref)
(local $local_funcref funcref)
(local $local_anyref anyref)
(local.set $local_externref
@@ -46,7 +44,7 @@
(global.get $global_externref)
)
(local.set $local_externref
- (ref.null extern)
+ (ref.null any)
)
(local.set $local_funcref
(local.get $local_funcref)
@@ -76,7 +74,7 @@
(global.get $global_externref)
)
(local.set $local_anyref
- (ref.null extern)
+ (ref.null any)
)
(local.set $local_anyref
(local.get $local_funcref)
@@ -97,7 +95,7 @@
(local.get $local_externref)
)
(global.set $global_externref
- (ref.null extern)
+ (ref.null any)
)
(global.set $global_funcref
(global.get $global_funcref)
@@ -127,7 +125,7 @@
(local.get $local_externref)
)
(global.set $global_anyref
- (ref.null extern)
+ (ref.null any)
)
(global.set $global_anyref
(global.get $global_funcref)
@@ -148,7 +146,7 @@
(global.get $global_externref)
)
(call $take_externref
- (ref.null extern)
+ (ref.null any)
)
(call $take_funcref
(local.get $local_funcref)
@@ -178,7 +176,7 @@
(global.get $global_externref)
)
(call $take_anyref
- (ref.null extern)
+ (ref.null any)
)
(call $take_anyref
(local.get $local_funcref)
@@ -192,16 +190,16 @@
(call $take_anyref
(ref.func $foo)
)
- (call_indirect $0 (type $sig_externref)
+ (call_indirect $0 (type $sig_anyref)
(local.get $local_externref)
(i32.const 0)
)
- (call_indirect $0 (type $sig_externref)
+ (call_indirect $0 (type $sig_anyref)
(global.get $global_externref)
(i32.const 0)
)
- (call_indirect $0 (type $sig_externref)
- (ref.null extern)
+ (call_indirect $0 (type $sig_anyref)
+ (ref.null any)
(i32.const 0)
)
(call_indirect $0 (type $sig_funcref)
@@ -241,7 +239,7 @@
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
- (ref.null extern)
+ (ref.null any)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
@@ -261,7 +259,7 @@
(i32.const 3)
)
(drop
- (block $block (result externref)
+ (block $block (result anyref)
(br_if $block
(local.get $local_externref)
(i32.const 1)
@@ -269,7 +267,7 @@
)
)
(drop
- (block $block0 (result externref)
+ (block $block0 (result anyref)
(br_if $block0
(global.get $global_externref)
(i32.const 1)
@@ -277,9 +275,9 @@
)
)
(drop
- (block $block1 (result externref)
+ (block $block1 (result anyref)
(br_if $block1
- (ref.null extern)
+ (ref.null any)
(i32.const 1)
)
)
@@ -359,7 +357,7 @@
(drop
(block $block11 (result anyref)
(br_if $block11
- (ref.null extern)
+ (ref.null any)
(i32.const 1)
)
)
@@ -381,18 +379,18 @@
)
)
(drop
- (loop $loop-in (result externref)
+ (loop $loop-in (result anyref)
(local.get $local_externref)
)
)
(drop
- (loop $loop-in14 (result externref)
+ (loop $loop-in14 (result anyref)
(global.get $global_externref)
)
)
(drop
- (loop $loop-in15 (result externref)
- (ref.null extern)
+ (loop $loop-in15 (result anyref)
+ (ref.null any)
)
)
(drop
@@ -442,7 +440,7 @@
)
(drop
(loop $loop-in25 (result anyref)
- (ref.null extern)
+ (ref.null any)
)
)
(drop
@@ -466,10 +464,10 @@
)
)
(drop
- (if (result externref)
+ (if (result anyref)
(i32.const 1)
(local.get $local_externref)
- (ref.null extern)
+ (ref.null any)
)
)
(drop
@@ -496,7 +494,7 @@
(drop
(if (result anyref)
(i32.const 1)
- (ref.null extern)
+ (ref.null any)
(ref.null func)
)
)
@@ -504,11 +502,11 @@
(if (result anyref)
(i32.const 1)
(ref.func $foo)
- (ref.null extern)
+ (ref.null any)
)
)
(drop
- (try $try (result externref)
+ (try $try (result anyref)
(do
(local.get $local_externref)
)
@@ -516,7 +514,7 @@
(drop
(pop i32)
)
- (ref.null extern)
+ (ref.null any)
)
)
)
@@ -560,9 +558,9 @@
)
)
(drop
- (select (result externref)
+ (select (result anyref)
(local.get $local_externref)
- (ref.null extern)
+ (ref.null any)
(i32.const 1)
)
)
@@ -606,7 +604,7 @@
)
(drop
(ref.is_null
- (ref.null extern)
+ (ref.null any)
)
)
(drop
@@ -645,15 +643,15 @@
)
)
)
- (func $return_externref_local (result externref)
- (local $local_externref externref)
+ (func $return_externref_local (result anyref)
+ (local $local_externref anyref)
(local.get $local_externref)
)
- (func $return_externref_global (result externref)
+ (func $return_externref_global (result anyref)
(global.get $global_externref)
)
- (func $return_externref_null (result externref)
- (ref.null extern)
+ (func $return_externref_null (result anyref)
+ (ref.null any)
)
(func $return_funcref_local (result funcref)
(local $local_funcref funcref)
@@ -679,14 +677,14 @@
(ref.null any)
)
(func $return_anyref2 (result anyref)
- (local $local_externref externref)
+ (local $local_externref anyref)
(local.get $local_externref)
)
(func $return_anyref3 (result anyref)
(global.get $global_externref)
)
(func $return_anyref4 (result anyref)
- (ref.null extern)
+ (ref.null any)
)
(func $return_anyref5 (result anyref)
(local $local_funcref funcref)
@@ -701,8 +699,8 @@
(func $return_anyref8 (result anyref)
(ref.func $foo)
)
- (func $returns_externref (result externref)
- (local $local_externref externref)
+ (func $returns_externref (result anyref)
+ (local $local_externref anyref)
(return
(local.get $local_externref)
)
@@ -710,7 +708,7 @@
(global.get $global_externref)
)
(return
- (ref.null extern)
+ (ref.null any)
)
)
(func $returns_funcref (result funcref)
@@ -741,7 +739,7 @@
)
)
(func $returns_anyref2 (result anyref)
- (local $local_externref externref)
+ (local $local_externref anyref)
(local $local_funcref funcref)
(return
(local.get $local_externref)
@@ -750,7 +748,7 @@
(global.get $global_externref)
)
(return
- (ref.null extern)
+ (ref.null any)
)
(return
(local.get $local_funcref)
diff --git a/test/reference-types.wast.fromBinary b/test/reference-types.wast.fromBinary
index ad2d8862f..37a57ac78 100644
--- a/test/reference-types.wast.fromBinary
+++ b/test/reference-types.wast.fromBinary
@@ -3,18 +3,16 @@
(type $sig_anyref (func (param anyref)))
(type $sig_funcref (func (param funcref)))
(type $none_=>_funcref (func (result funcref)))
- (type $sig_externref (func (param externref)))
(type $none_=>_none (func))
- (type $none_=>_externref (func (result externref)))
(type $i32_=>_none (func (param i32)))
- (type $externref_=>_funcref (func (param externref) (result funcref)))
- (import "env" "import_global" (global $import_global externref))
- (import "env" "import_func" (func $import_func (param externref) (result funcref)))
- (global $global_externref (mut externref) (ref.null extern))
+ (type $anyref_=>_funcref (func (param anyref) (result funcref)))
+ (import "env" "import_global" (global $import_global anyref))
+ (import "env" "import_func" (func $import_func (param anyref) (result funcref)))
+ (global $global_externref (mut anyref) (ref.null any))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
(global $global_anyref (mut anyref) (ref.null any))
- (global $global_anyref2 (mut anyref) (ref.null extern))
+ (global $global_anyref2 (mut anyref) (ref.null any))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
(table $0 3 3 funcref)
@@ -23,7 +21,7 @@
(tag $tag$0 (param i32))
(export "export_func" (func $import_func))
(export "export_global" (global $import_global))
- (func $take_externref (param $0 externref)
+ (func $take_externref (param $0 anyref)
(nop)
)
(func $take_funcref (param $0 funcref)
@@ -36,9 +34,9 @@
(nop)
)
(func $test
- (local $local_externref externref)
- (local $local_funcref funcref)
+ (local $local_externref anyref)
(local $local_anyref anyref)
+ (local $local_funcref funcref)
(local.set $local_externref
(local.get $local_externref)
)
@@ -46,7 +44,7 @@
(global.get $global_externref)
)
(local.set $local_externref
- (ref.null extern)
+ (ref.null any)
)
(local.set $local_funcref
(local.get $local_funcref)
@@ -76,7 +74,7 @@
(global.get $global_externref)
)
(local.set $local_anyref
- (ref.null extern)
+ (ref.null any)
)
(local.set $local_anyref
(local.get $local_funcref)
@@ -97,7 +95,7 @@
(local.get $local_externref)
)
(global.set $global_externref
- (ref.null extern)
+ (ref.null any)
)
(global.set $global_funcref
(global.get $global_funcref)
@@ -127,7 +125,7 @@
(local.get $local_externref)
)
(global.set $global_anyref
- (ref.null extern)
+ (ref.null any)
)
(global.set $global_anyref
(global.get $global_funcref)
@@ -148,7 +146,7 @@
(global.get $global_externref)
)
(call $take_externref
- (ref.null extern)
+ (ref.null any)
)
(call $take_funcref
(local.get $local_funcref)
@@ -178,7 +176,7 @@
(global.get $global_externref)
)
(call $take_anyref
- (ref.null extern)
+ (ref.null any)
)
(call $take_anyref
(local.get $local_funcref)
@@ -192,16 +190,16 @@
(call $take_anyref
(ref.func $foo)
)
- (call_indirect $0 (type $sig_externref)
+ (call_indirect $0 (type $sig_anyref)
(local.get $local_externref)
(i32.const 0)
)
- (call_indirect $0 (type $sig_externref)
+ (call_indirect $0 (type $sig_anyref)
(global.get $global_externref)
(i32.const 0)
)
- (call_indirect $0 (type $sig_externref)
- (ref.null extern)
+ (call_indirect $0 (type $sig_anyref)
+ (ref.null any)
(i32.const 0)
)
(call_indirect $0 (type $sig_funcref)
@@ -241,7 +239,7 @@
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
- (ref.null extern)
+ (ref.null any)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
@@ -261,7 +259,7 @@
(i32.const 3)
)
(drop
- (block $label$1 (result externref)
+ (block $label$1 (result anyref)
(br_if $label$1
(local.get $local_externref)
(i32.const 1)
@@ -269,7 +267,7 @@
)
)
(drop
- (block $label$2 (result externref)
+ (block $label$2 (result anyref)
(br_if $label$2
(global.get $global_externref)
(i32.const 1)
@@ -277,9 +275,9 @@
)
)
(drop
- (block $label$3 (result externref)
+ (block $label$3 (result anyref)
(br_if $label$3
- (ref.null extern)
+ (ref.null any)
(i32.const 1)
)
)
@@ -359,7 +357,7 @@
(drop
(block $label$13 (result anyref)
(br_if $label$13
- (ref.null extern)
+ (ref.null any)
(i32.const 1)
)
)
@@ -381,18 +379,18 @@
)
)
(drop
- (loop $label$16 (result externref)
+ (loop $label$16 (result anyref)
(local.get $local_externref)
)
)
(drop
- (loop $label$17 (result externref)
+ (loop $label$17 (result anyref)
(global.get $global_externref)
)
)
(drop
- (loop $label$18 (result externref)
- (ref.null extern)
+ (loop $label$18 (result anyref)
+ (ref.null any)
)
)
(drop
@@ -442,7 +440,7 @@
)
(drop
(loop $label$28 (result anyref)
- (ref.null extern)
+ (ref.null any)
)
)
(drop
@@ -466,10 +464,10 @@
)
)
(drop
- (if (result externref)
+ (if (result anyref)
(i32.const 1)
(local.get $local_externref)
- (ref.null extern)
+ (ref.null any)
)
)
(drop
@@ -496,7 +494,7 @@
(drop
(if (result anyref)
(i32.const 1)
- (ref.null extern)
+ (ref.null any)
(ref.null func)
)
)
@@ -504,11 +502,11 @@
(if (result anyref)
(i32.const 1)
(ref.func $foo)
- (ref.null extern)
+ (ref.null any)
)
)
(drop
- (try $label$47 (result externref)
+ (try $label$47 (result anyref)
(do
(local.get $local_externref)
)
@@ -516,7 +514,7 @@
(drop
(pop i32)
)
- (ref.null extern)
+ (ref.null any)
)
)
)
@@ -560,9 +558,9 @@
)
)
(drop
- (select (result externref)
+ (select (result anyref)
(local.get $local_externref)
- (ref.null extern)
+ (ref.null any)
(i32.const 1)
)
)
@@ -606,7 +604,7 @@
)
(drop
(ref.is_null
- (ref.null extern)
+ (ref.null any)
)
)
(drop
@@ -645,15 +643,15 @@
)
)
)
- (func $return_externref_local (result externref)
- (local $local_externref externref)
+ (func $return_externref_local (result anyref)
+ (local $local_externref anyref)
(local.get $local_externref)
)
- (func $return_externref_global (result externref)
+ (func $return_externref_global (result anyref)
(global.get $global_externref)
)
- (func $return_externref_null (result externref)
- (ref.null extern)
+ (func $return_externref_null (result anyref)
+ (ref.null any)
)
(func $return_funcref_local (result funcref)
(local $local_funcref funcref)
@@ -679,14 +677,14 @@
(ref.null any)
)
(func $return_anyref2 (result anyref)
- (local $local_externref externref)
+ (local $local_externref anyref)
(local.get $local_externref)
)
(func $return_anyref3 (result anyref)
(global.get $global_externref)
)
(func $return_anyref4 (result anyref)
- (ref.null extern)
+ (ref.null any)
)
(func $return_anyref5 (result anyref)
(local $local_funcref funcref)
@@ -701,8 +699,8 @@
(func $return_anyref8 (result anyref)
(ref.func $foo)
)
- (func $returns_externref (result externref)
- (local $local_externref externref)
+ (func $returns_externref (result anyref)
+ (local $local_externref anyref)
(return
(local.get $local_externref)
)
@@ -720,7 +718,7 @@
)
)
(func $returns_anyref2 (result anyref)
- (local $local_externref externref)
+ (local $local_externref anyref)
(local $local_funcref funcref)
(return
(local.get $local_externref)
diff --git a/test/reference-types.wast.fromBinary.noDebugInfo b/test/reference-types.wast.fromBinary.noDebugInfo
index 264539142..42ad4026a 100644
--- a/test/reference-types.wast.fromBinary.noDebugInfo
+++ b/test/reference-types.wast.fromBinary.noDebugInfo
@@ -3,18 +3,16 @@
(type $anyref_=>_none (func (param anyref)))
(type $funcref_=>_none (func (param funcref)))
(type $none_=>_funcref (func (result funcref)))
- (type $externref_=>_none (func (param externref)))
(type $none_=>_none (func))
- (type $none_=>_externref (func (result externref)))
(type $i32_=>_none (func (param i32)))
- (type $externref_=>_funcref (func (param externref) (result funcref)))
- (import "env" "import_global" (global $gimport$0 externref))
- (import "env" "import_func" (func $fimport$0 (param externref) (result funcref)))
- (global $global$0 (mut externref) (ref.null extern))
+ (type $anyref_=>_funcref (func (param anyref) (result funcref)))
+ (import "env" "import_global" (global $gimport$0 anyref))
+ (import "env" "import_func" (func $fimport$0 (param anyref) (result funcref)))
+ (global $global$0 (mut anyref) (ref.null any))
(global $global$1 (mut funcref) (ref.null func))
(global $global$2 (mut funcref) (ref.func $3))
(global $global$3 (mut anyref) (ref.null any))
- (global $global$4 (mut anyref) (ref.null extern))
+ (global $global$4 (mut anyref) (ref.null any))
(global $global$5 (mut anyref) (ref.null func))
(global $global$6 (mut anyref) (ref.func $3))
(table $0 3 3 funcref)
@@ -23,7 +21,7 @@
(tag $tag$0 (param i32))
(export "export_func" (func $fimport$0))
(export "export_global" (global $gimport$0))
- (func $0 (param $0 externref)
+ (func $0 (param $0 anyref)
(nop)
)
(func $1 (param $0 funcref)
@@ -36,9 +34,9 @@
(nop)
)
(func $4
- (local $0 externref)
- (local $1 funcref)
- (local $2 anyref)
+ (local $0 anyref)
+ (local $1 anyref)
+ (local $2 funcref)
(local.set $0
(local.get $0)
)
@@ -46,48 +44,48 @@
(global.get $global$0)
)
(local.set $0
- (ref.null extern)
+ (ref.null any)
)
- (local.set $1
- (local.get $1)
+ (local.set $2
+ (local.get $2)
)
- (local.set $1
+ (local.set $2
(global.get $global$1)
)
- (local.set $1
+ (local.set $2
(ref.null func)
)
- (local.set $1
+ (local.set $2
(ref.func $3)
)
- (local.set $2
- (local.get $2)
+ (local.set $1
+ (local.get $1)
)
- (local.set $2
+ (local.set $1
(global.get $global$3)
)
- (local.set $2
+ (local.set $1
(ref.null any)
)
- (local.set $2
+ (local.set $1
(local.get $0)
)
- (local.set $2
+ (local.set $1
(global.get $global$0)
)
- (local.set $2
- (ref.null extern)
+ (local.set $1
+ (ref.null any)
)
- (local.set $2
- (local.get $1)
+ (local.set $1
+ (local.get $2)
)
- (local.set $2
+ (local.set $1
(global.get $global$1)
)
- (local.set $2
+ (local.set $1
(ref.null func)
)
- (local.set $2
+ (local.set $1
(ref.func $3)
)
(global.set $global$0
@@ -97,13 +95,13 @@
(local.get $0)
)
(global.set $global$0
- (ref.null extern)
+ (ref.null any)
)
(global.set $global$1
(global.get $global$1)
)
(global.set $global$1
- (local.get $1)
+ (local.get $2)
)
(global.set $global$1
(ref.null func)
@@ -115,7 +113,7 @@
(global.get $global$3)
)
(global.set $global$3
- (local.get $2)
+ (local.get $1)
)
(global.set $global$3
(ref.null any)
@@ -127,13 +125,13 @@
(local.get $0)
)
(global.set $global$3
- (ref.null extern)
+ (ref.null any)
)
(global.set $global$3
(global.get $global$1)
)
(global.set $global$3
- (local.get $1)
+ (local.get $2)
)
(global.set $global$3
(ref.null func)
@@ -148,10 +146,10 @@
(global.get $global$0)
)
(call $0
- (ref.null extern)
+ (ref.null any)
)
(call $1
- (local.get $1)
+ (local.get $2)
)
(call $1
(global.get $global$1)
@@ -163,7 +161,7 @@
(ref.func $3)
)
(call $2
- (local.get $2)
+ (local.get $1)
)
(call $2
(global.get $global$3)
@@ -178,10 +176,10 @@
(global.get $global$0)
)
(call $2
- (ref.null extern)
+ (ref.null any)
)
(call $2
- (local.get $1)
+ (local.get $2)
)
(call $2
(global.get $global$1)
@@ -192,20 +190,20 @@
(call $2
(ref.func $3)
)
- (call_indirect $0 (type $externref_=>_none)
+ (call_indirect $0 (type $anyref_=>_none)
(local.get $0)
(i32.const 0)
)
- (call_indirect $0 (type $externref_=>_none)
+ (call_indirect $0 (type $anyref_=>_none)
(global.get $global$0)
(i32.const 0)
)
- (call_indirect $0 (type $externref_=>_none)
- (ref.null extern)
+ (call_indirect $0 (type $anyref_=>_none)
+ (ref.null any)
(i32.const 0)
)
(call_indirect $0 (type $funcref_=>_none)
- (local.get $1)
+ (local.get $2)
(i32.const 1)
)
(call_indirect $0 (type $funcref_=>_none)
@@ -221,7 +219,7 @@
(i32.const 1)
)
(call_indirect $0 (type $anyref_=>_none)
- (local.get $2)
+ (local.get $1)
(i32.const 3)
)
(call_indirect $0 (type $anyref_=>_none)
@@ -241,11 +239,11 @@
(i32.const 3)
)
(call_indirect $0 (type $anyref_=>_none)
- (ref.null extern)
+ (ref.null any)
(i32.const 3)
)
(call_indirect $0 (type $anyref_=>_none)
- (local.get $1)
+ (local.get $2)
(i32.const 3)
)
(call_indirect $0 (type $anyref_=>_none)
@@ -261,7 +259,7 @@
(i32.const 3)
)
(drop
- (block $label$1 (result externref)
+ (block $label$1 (result anyref)
(br_if $label$1
(local.get $0)
(i32.const 1)
@@ -269,7 +267,7 @@
)
)
(drop
- (block $label$2 (result externref)
+ (block $label$2 (result anyref)
(br_if $label$2
(global.get $global$0)
(i32.const 1)
@@ -277,9 +275,9 @@
)
)
(drop
- (block $label$3 (result externref)
+ (block $label$3 (result anyref)
(br_if $label$3
- (ref.null extern)
+ (ref.null any)
(i32.const 1)
)
)
@@ -287,7 +285,7 @@
(drop
(block $label$4 (result funcref)
(br_if $label$4
- (local.get $1)
+ (local.get $2)
(i32.const 1)
)
)
@@ -319,7 +317,7 @@
(drop
(block $label$8 (result anyref)
(br_if $label$8
- (local.get $2)
+ (local.get $1)
(i32.const 1)
)
)
@@ -351,7 +349,7 @@
(drop
(block $label$12 (result anyref)
(br_if $label$12
- (local.get $1)
+ (local.get $2)
(i32.const 1)
)
)
@@ -359,7 +357,7 @@
(drop
(block $label$13 (result anyref)
(br_if $label$13
- (ref.null extern)
+ (ref.null any)
(i32.const 1)
)
)
@@ -381,23 +379,23 @@
)
)
(drop
- (loop $label$16 (result externref)
+ (loop $label$16 (result anyref)
(local.get $0)
)
)
(drop
- (loop $label$17 (result externref)
+ (loop $label$17 (result anyref)
(global.get $global$0)
)
)
(drop
- (loop $label$18 (result externref)
- (ref.null extern)
+ (loop $label$18 (result anyref)
+ (ref.null any)
)
)
(drop
(loop $label$19 (result funcref)
- (local.get $1)
+ (local.get $2)
)
)
(drop
@@ -417,7 +415,7 @@
)
(drop
(loop $label$23 (result anyref)
- (local.get $2)
+ (local.get $1)
)
)
(drop
@@ -442,12 +440,12 @@
)
(drop
(loop $label$28 (result anyref)
- (ref.null extern)
+ (ref.null any)
)
)
(drop
(loop $label$29 (result anyref)
- (local.get $1)
+ (local.get $2)
)
)
(drop
@@ -466,23 +464,23 @@
)
)
(drop
- (if (result externref)
+ (if (result anyref)
(i32.const 1)
(local.get $0)
- (ref.null extern)
+ (ref.null any)
)
)
(drop
(if (result funcref)
(i32.const 1)
- (local.get $1)
+ (local.get $2)
(ref.null func)
)
)
(drop
(if (result anyref)
(i32.const 1)
- (local.get $2)
+ (local.get $1)
(ref.null any)
)
)
@@ -490,13 +488,13 @@
(if (result anyref)
(i32.const 1)
(local.get $0)
- (local.get $1)
+ (local.get $2)
)
)
(drop
(if (result anyref)
(i32.const 1)
- (ref.null extern)
+ (ref.null any)
(ref.null func)
)
)
@@ -504,11 +502,11 @@
(if (result anyref)
(i32.const 1)
(ref.func $3)
- (ref.null extern)
+ (ref.null any)
)
)
(drop
- (try $label$47 (result externref)
+ (try $label$47 (result anyref)
(do
(local.get $0)
)
@@ -516,7 +514,7 @@
(drop
(pop i32)
)
- (ref.null extern)
+ (ref.null any)
)
)
)
@@ -560,15 +558,15 @@
)
)
(drop
- (select (result externref)
+ (select (result anyref)
(local.get $0)
- (ref.null extern)
+ (ref.null any)
(i32.const 1)
)
)
(drop
(select (result funcref)
- (local.get $1)
+ (local.get $2)
(ref.null func)
(i32.const 1)
)
@@ -583,13 +581,13 @@
(drop
(select (result anyref)
(local.get $0)
- (local.get $1)
+ (local.get $2)
(i32.const 1)
)
)
(drop
(select (result anyref)
- (local.get $1)
+ (local.get $2)
(local.get $0)
(i32.const 1)
)
@@ -606,12 +604,12 @@
)
(drop
(ref.is_null
- (ref.null extern)
+ (ref.null any)
)
)
(drop
(ref.is_null
- (local.get $1)
+ (local.get $2)
)
)
(drop
@@ -631,7 +629,7 @@
)
(drop
(ref.is_null
- (local.get $2)
+ (local.get $1)
)
)
(drop
@@ -645,15 +643,15 @@
)
)
)
- (func $5 (result externref)
- (local $0 externref)
+ (func $5 (result anyref)
+ (local $0 anyref)
(local.get $0)
)
- (func $6 (result externref)
+ (func $6 (result anyref)
(global.get $global$0)
)
- (func $7 (result externref)
- (ref.null extern)
+ (func $7 (result anyref)
+ (ref.null any)
)
(func $8 (result funcref)
(local $0 funcref)
@@ -679,14 +677,14 @@
(ref.null any)
)
(func $15 (result anyref)
- (local $0 externref)
+ (local $0 anyref)
(local.get $0)
)
(func $16 (result anyref)
(global.get $global$0)
)
(func $17 (result anyref)
- (ref.null extern)
+ (ref.null any)
)
(func $18 (result anyref)
(local $0 funcref)
@@ -701,8 +699,8 @@
(func $21 (result anyref)
(ref.func $3)
)
- (func $22 (result externref)
- (local $0 externref)
+ (func $22 (result anyref)
+ (local $0 anyref)
(return
(local.get $0)
)
@@ -720,7 +718,7 @@
)
)
(func $25 (result anyref)
- (local $0 externref)
+ (local $0 anyref)
(local $1 funcref)
(return
(local.get $0)
diff --git a/test/unit/input/gc_target_feature.wasm b/test/unit/input/gc_target_feature.wasm
index fce4e1412..df5ab9cc0 100644
--- a/test/unit/input/gc_target_feature.wasm
+++ b/test/unit/input/gc_target_feature.wasm
Binary files differ
diff --git a/test/unit/test_features.py b/test/unit/test_features.py
index 408084086..53c2263f3 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -245,19 +245,19 @@ class FeatureValidationTest(utils.BinaryenTestCase):
self.check_multivalue(module, 'Multivalue block type ' +
'(multivalue is not enabled)')
- def test_anyref_global(self):
+ def test_i31_global(self):
module = '''
(module
- (global $foo anyref (ref.null any))
+ (global $foo (ref null i31) (ref.null i31))
)
'''
self.check_gc(module, 'all used types should be allowed')
- def test_anyref_local(self):
+ def test_i31_local(self):
module = '''
(module
(func $foo
- (local $0 anyref)
+ (local $0 (ref null i31))
)
)
'''
@@ -330,7 +330,7 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase):
filename = 'reference_types_target_feature.wasm'
self.roundtrip(filename)
self.check_features(filename, ['reference-types'])
- self.assertIn('externref', self.disassemble(filename))
+ self.assertIn('anyref', self.disassemble(filename))
def test_exception_handling(self):
filename = 'exception_handling_target_feature.wasm'