summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/fuzz_opt.py10
-rw-r--r--src/binaryen-c.cpp4
-rw-r--r--src/binaryen-c.h2
-rw-r--r--src/js/binaryen.js-post.js2
-rw-r--r--src/passes/InstrumentLocals.cpp2
-rw-r--r--src/tools/fuzzing.h27
-rw-r--r--src/tools/tool-options.h2
-rw-r--r--src/wasm-binary.h2
-rw-r--r--src/wasm-features.h10
-rw-r--r--src/wasm/wasm-binary.cpp8
-rw-r--r--src/wasm/wasm-type.cpp2
-rw-r--r--src/wasm/wasm-validator.cpp4
-rw-r--r--src/wasm/wasm.cpp2
-rw-r--r--test/binaryen.js/kitchen-sink.js2
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt2
-rw-r--r--test/example/c-api-kitchen-sink.c2
-rw-r--r--test/example/c-api-kitchen-sink.txt2
-rw-r--r--test/passes/strip-target-features_roundtrip_print-features_all-features.txt2
-rw-r--r--test/passes/translate-to-fuzz_all-features.txt107
-rw-r--r--test/unit/input/anyref_target_feature.wasmbin60 -> 0 bytes
-rw-r--r--test/unit/input/gc_target_feature.wasmbin0 -> 56 bytes
-rw-r--r--test/unit/test_features.py18
22 files changed, 64 insertions, 148 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index 3562a82f6..3f79ec565 100755
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -404,7 +404,7 @@ class CompareVMs(TestCaseHandler):
if random.random() < 0.5:
return False
# wasm2c doesn't support most features
- return all([x in FEATURE_OPTS for x in ['--disable-exception-handling', '--disable-simd', '--disable-threads', '--disable-bulk-memory', '--disable-nontrapping-float-to-int', '--disable-tail-call', '--disable-sign-ext', '--disable-reference-types', '--disable-multivalue', '--disable-anyref']])
+ return all([x in FEATURE_OPTS for x in ['--disable-exception-handling', '--disable-simd', '--disable-threads', '--disable-bulk-memory', '--disable-nontrapping-float-to-int', '--disable-tail-call', '--disable-sign-ext', '--disable-reference-types', '--disable-multivalue', '--disable-gc']])
def run(self, wasm):
run([in_bin('wasm-opt'), wasm, '--emit-wasm2c-wrapper=main.c'] + FEATURE_OPTS)
@@ -504,7 +504,7 @@ class CompareVMs(TestCaseHandler):
compare(before[vm], after[vm], 'CompareVMs between before and after: ' + vm.name)
def can_run_on_feature_opts(self, feature_opts):
- return all([x in feature_opts for x in ['--disable-simd', '--disable-reference-types', '--disable-exception-handling', '--disable-multivalue', '--disable-anyref']])
+ return all([x in feature_opts for x in ['--disable-simd', '--disable-reference-types', '--disable-exception-handling', '--disable-multivalue', '--disable-gc']])
# Check for determinism - the same command must have the same output.
@@ -635,7 +635,7 @@ class Wasm2JS(TestCaseHandler):
return run_vm([shared.NODEJS, js_file, 'a.wasm'])
def can_run_on_feature_opts(self, feature_opts):
- return all([x in feature_opts for x in ['--disable-exception-handling', '--disable-simd', '--disable-threads', '--disable-bulk-memory', '--disable-nontrapping-float-to-int', '--disable-tail-call', '--disable-sign-ext', '--disable-reference-types', '--disable-multivalue', '--disable-anyref']])
+ return all([x in feature_opts for x in ['--disable-exception-handling', '--disable-simd', '--disable-threads', '--disable-bulk-memory', '--disable-nontrapping-float-to-int', '--disable-tail-call', '--disable-sign-ext', '--disable-reference-types', '--disable-multivalue', '--disable-gc']])
class Asyncify(TestCaseHandler):
@@ -689,7 +689,7 @@ class Asyncify(TestCaseHandler):
compare(before, after_asyncify, 'Asyncify (before/after_asyncify)')
def can_run_on_feature_opts(self, feature_opts):
- return all([x in feature_opts for x in ['--disable-exception-handling', '--disable-simd', '--disable-tail-call', '--disable-reference-types', '--disable-multivalue', '--disable-anyref']])
+ return all([x in feature_opts for x in ['--disable-exception-handling', '--disable-simd', '--disable-tail-call', '--disable-reference-types', '--disable-multivalue', '--disable-gc']])
# The global list of all test case handlers
@@ -875,7 +875,7 @@ print('POSSIBLE_FEATURE_OPTS:', POSSIBLE_FEATURE_OPTS)
# some features depend on other features, so if a required feature is
# disabled, its dependent features need to be disabled as well.
IMPLIED_FEATURE_OPTS = {
- '--disable-reference-types': ['--disable-exception-handling', '--disable-anyref']
+ '--disable-reference-types': ['--disable-exception-handling', '--disable-gc']
}
if __name__ == '__main__':
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index 3582c99ca..3084ae2ae 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -327,8 +327,8 @@ BinaryenFeatures BinaryenFeatureReferenceTypes(void) {
BinaryenFeatures BinaryenFeatureMultivalue(void) {
return static_cast<BinaryenFeatures>(FeatureSet::Multivalue);
}
-BinaryenFeatures BinaryenFeatureAnyref(void) {
- return static_cast<BinaryenFeatures>(FeatureSet::Anyref);
+BinaryenFeatures BinaryenFeatureGC(void) {
+ return static_cast<BinaryenFeatures>(FeatureSet::GC);
}
BinaryenFeatures BinaryenFeatureAll(void) {
return static_cast<BinaryenFeatures>(FeatureSet::All);
diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index fdef58410..c462bfc0f 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -197,7 +197,7 @@ BINARYEN_API BinaryenFeatures BinaryenFeatureExceptionHandling(void);
BINARYEN_API BinaryenFeatures BinaryenFeatureTailCall(void);
BINARYEN_API BinaryenFeatures BinaryenFeatureReferenceTypes(void);
BINARYEN_API BinaryenFeatures BinaryenFeatureMultivalue(void);
-BINARYEN_API BinaryenFeatures BinaryenFeatureAnyref(void);
+BINARYEN_API BinaryenFeatures BinaryenFeatureGC(void);
BINARYEN_API BinaryenFeatures BinaryenFeatureAll(void);
// Modules
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js
index d7c1878fd..7f5467312 100644
--- a/src/js/binaryen.js-post.js
+++ b/src/js/binaryen.js-post.js
@@ -121,7 +121,7 @@ function initializeConstants() {
'TailCall',
'ReferenceTypes',
'Multivalue',
- 'Anyref',
+ 'GC',
'All'
].forEach(name => {
Module['Features'][name] = Module['_BinaryenFeature' + name]();
diff --git a/src/passes/InstrumentLocals.cpp b/src/passes/InstrumentLocals.cpp
index b1ce5f05e..f9c26d788 100644
--- a/src/passes/InstrumentLocals.cpp
+++ b/src/passes/InstrumentLocals.cpp
@@ -198,7 +198,7 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
addImport(
curr, set_exnref, {Type::i32, Type::i32, Type::exnref}, Type::exnref);
}
- if (curr->features.hasAnyref()) {
+ if (curr->features.hasGC()) {
addImport(
curr, get_anyref, {Type::i32, Type::i32, Type::anyref}, Type::anyref);
addImport(
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h
index 9768b63c4..e6cc4e444 100644
--- a/src/tools/fuzzing.h
+++ b/src/tools/fuzzing.h
@@ -848,8 +848,7 @@ private:
}
Expression* _makeConcrete(Type type) {
- bool canMakeControlFlow =
- !type.isTuple() || wasm.features.has(FeatureSet::Multivalue);
+ bool canMakeControlFlow = !type.isTuple() || wasm.features.hasMultivalue();
using Self = TranslateToFuzzReader;
FeatureOptions<Expression* (Self::*)(Type)> options;
using WeightedOption = decltype(options)::WeightedOption;
@@ -2609,16 +2608,7 @@ private:
Expression* makeRefIsNull(Type type) {
assert(type == Type::i32);
assert(wasm.features.hasReferenceTypes());
- SmallVector<Type, 2> options;
- options.push_back(Type::externref);
- options.push_back(Type::funcref);
- if (wasm.features.hasExceptionHandling()) {
- options.push_back(Type::exnref);
- }
- if (wasm.features.hasAnyref()) {
- options.push_back(Type::anyref);
- }
- return builder.makeRefIsNull(make(pick(options)));
+ return builder.makeRefIsNull(make(getReferenceType()));
}
Expression* makeMemoryInit() {
@@ -2684,11 +2674,22 @@ private:
.add(FeatureSet::ReferenceTypes, Type::funcref, Type::externref)
.add(FeatureSet::ReferenceTypes | FeatureSet::ExceptionHandling,
Type::exnref)
- .add(FeatureSet::ReferenceTypes | FeatureSet::Anyref, Type::anyref));
+ .add(FeatureSet::ReferenceTypes | FeatureSet::GC, Type::anyref));
}
Type getSingleConcreteType() { return pick(getSingleConcreteTypes()); }
+ std::vector<Type> getReferenceTypes() {
+ return items(
+ FeatureOptions<Type>()
+ .add(FeatureSet::ReferenceTypes, Type::funcref, Type::externref)
+ .add(FeatureSet::ReferenceTypes | FeatureSet::ExceptionHandling,
+ Type::exnref)
+ .add(FeatureSet::ReferenceTypes | FeatureSet::GC, Type::anyref));
+ }
+
+ Type getReferenceType() { return pick(getReferenceTypes()); }
+
Type getTupleType() {
std::vector<Type> elements;
size_t numElements = 2 + upTo(MAX_TUPLE_SIZE - 1);
diff --git a/src/tools/tool-options.h b/src/tools/tool-options.h
index 082e95549..2e7158b34 100644
--- a/src/tools/tool-options.h
+++ b/src/tools/tool-options.h
@@ -87,7 +87,7 @@ struct ToolOptions : public Options {
.addFeature(FeatureSet::TailCall, "tail call operations")
.addFeature(FeatureSet::ReferenceTypes, "reference types")
.addFeature(FeatureSet::Multivalue, "multivalue functions")
- .addFeature(FeatureSet::Anyref, "anyref type (without GC)")
+ .addFeature(FeatureSet::GC, "garbage collection")
.add("--no-validation",
"-n",
"Disables validation, assumes inputs are correct",
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index b979be853..77f53fcd2 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -383,7 +383,7 @@ extern const char* ExceptionHandlingFeature;
extern const char* TailCallFeature;
extern const char* ReferenceTypesFeature;
extern const char* MultivalueFeature;
-extern const char* AnyrefFeature;
+extern const char* GCFeature;
enum Subsection {
NameModule = 0,
diff --git a/src/wasm-features.h b/src/wasm-features.h
index 5d05b6284..56436bd6a 100644
--- a/src/wasm-features.h
+++ b/src/wasm-features.h
@@ -36,7 +36,7 @@ struct FeatureSet {
TailCall = 1 << 7,
ReferenceTypes = 1 << 8,
Multivalue = 1 << 9,
- Anyref = 1 << 10,
+ GC = 1 << 10,
All = (1 << 11) - 1
};
@@ -62,8 +62,8 @@ struct FeatureSet {
return "reference-types";
case Multivalue:
return "multivalue";
- case Anyref:
- return "anyref";
+ case GC:
+ return "gc";
default:
WASM_UNREACHABLE("unexpected feature");
}
@@ -87,7 +87,7 @@ struct FeatureSet {
bool hasTailCall() const { return (features & TailCall) != 0; }
bool hasReferenceTypes() const { return (features & ReferenceTypes) != 0; }
bool hasMultivalue() const { return (features & Multivalue) != 0; }
- bool hasAnyref() const { return (features & Anyref) != 0; }
+ bool hasGC() const { return (features & GC) != 0; }
bool hasAll() const { return (features & All) != 0; }
void makeMVP() { features = MVP; }
@@ -104,7 +104,7 @@ struct FeatureSet {
void setTailCall(bool v = true) { set(TailCall, v); }
void setReferenceTypes(bool v = true) { set(ReferenceTypes, v); }
void setMultivalue(bool v = true) { set(Multivalue, v); }
- void setAnyref(bool v = true) { set(Anyref, v); }
+ void setGC(bool v = true) { set(GC, v); }
void setAll(bool v = true) { features = v ? All : MVP; }
void enable(const FeatureSet& other) { features |= other.features; }
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 5942a979f..2910bb383 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -750,8 +750,8 @@ void WasmBinaryWriter::writeFeaturesSection() {
return BinaryConsts::UserSections::ReferenceTypesFeature;
case FeatureSet::Multivalue:
return BinaryConsts::UserSections::MultivalueFeature;
- case FeatureSet::Anyref:
- return BinaryConsts::UserSections::AnyrefFeature;
+ case FeatureSet::GC:
+ return BinaryConsts::UserSections::GCFeature;
default:
WASM_UNREACHABLE("unexpected feature flag");
}
@@ -2307,8 +2307,8 @@ void WasmBinaryBuilder::readFeatures(size_t payloadLen) {
wasm.features.setReferenceTypes();
} else if (name == BinaryConsts::UserSections::MultivalueFeature) {
wasm.features.setMultivalue();
- } else if (name == BinaryConsts::UserSections::AnyrefFeature) {
- wasm.features.setAnyref();
+ } else if (name == BinaryConsts::UserSections::GCFeature) {
+ wasm.features.setGC();
}
}
}
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp
index 0c49e8dcc..d88b7b027 100644
--- a/src/wasm/wasm-type.cpp
+++ b/src/wasm/wasm-type.cpp
@@ -454,7 +454,7 @@ FeatureSet Type::getFeatures() const {
case Type::exnref:
return FeatureSet::ReferenceTypes | FeatureSet::ExceptionHandling;
case Type::anyref:
- return FeatureSet::ReferenceTypes | FeatureSet::Anyref;
+ return FeatureSet::ReferenceTypes | FeatureSet::GC;
default:
return FeatureSet::MVP;
}
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index 80c54abed..15fb66926 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -2478,10 +2478,10 @@ static void validateModule(Module& module, ValidationInfo& info) {
}
static void validateFeatures(Module& module, ValidationInfo& info) {
- if (module.features.hasAnyref()) {
+ if (module.features.hasGC()) {
info.shouldBeTrue(module.features.hasReferenceTypes(),
module.features,
- "--enable-anyref requires --enable-reference-types");
+ "--enable-gc requires --enable-reference-types");
}
if (module.features.hasExceptionHandling()) { // implies exnref
info.shouldBeTrue(
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index 5931b56aa..9d43a33b1 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -45,7 +45,7 @@ const char* SIMD128Feature = "simd128";
const char* TailCallFeature = "tail-call";
const char* ReferenceTypesFeature = "reference-types";
const char* MultivalueFeature = "multivalue";
-const char* AnyrefFeature = "anyref";
+const char* GCFeature = "gc";
} // namespace UserSections
} // namespace BinaryConsts
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index b90890466..5a3da277e 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -106,7 +106,7 @@ function test_features() {
console.log("Features.TailCall: " + binaryen.Features.TailCall);
console.log("Features.ReferenceTypes: " + binaryen.Features.ReferenceTypes);
console.log("Features.Multivalue: " + binaryen.Features.Multivalue);
- console.log("Features.Anyref: " + binaryen.Features.Anyref);
+ console.log("Features.GC: " + binaryen.Features.GC);
console.log("Features.All: " + binaryen.Features.All);
}
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index d31e341b2..2f75640d1 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -35,7 +35,7 @@ Features.ExceptionHandling: 64
Features.TailCall: 128
Features.ReferenceTypes: 256
Features.Multivalue: 512
-Features.Anyref: 1024
+Features.GC: 1024
Features.All: 2047
InvalidId: 0
BlockId: 1
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index e6450db6c..d4072476e 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -247,7 +247,7 @@ void test_features() {
printf("BinaryenFeatureTailCall: %d\n", BinaryenFeatureTailCall());
printf("BinaryenFeatureReferenceTypes: %d\n", BinaryenFeatureReferenceTypes());
printf("BinaryenFeatureMultivalue: %d\n", BinaryenFeatureMultivalue());
- printf("BinaryenFeatureAnyref: %d\n", BinaryenFeatureAnyref());
+ printf("BinaryenFeatureGC: %d\n", BinaryenFeatureGC());
printf("BinaryenFeatureAll: %d\n", BinaryenFeatureAll());
}
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index d4ff78dd2..b891bf6ce 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -21,7 +21,7 @@ BinaryenFeatureExceptionHandling: 64
BinaryenFeatureTailCall: 128
BinaryenFeatureReferenceTypes: 256
BinaryenFeatureMultivalue: 512
-BinaryenFeatureAnyref: 1024
+BinaryenFeatureGC: 1024
BinaryenFeatureAll: 2047
(f32.neg
(f32.const -33.61199951171875)
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 80e8d6bc7..33ce4d81a 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
@@ -8,7 +8,7 @@
--enable-tail-call
--enable-reference-types
--enable-multivalue
---enable-anyref
+--enable-gc
(module
(type $none_=>_v128_externref (func (result v128 externref)))
(func $foo (result v128 externref)
diff --git a/test/passes/translate-to-fuzz_all-features.txt b/test/passes/translate-to-fuzz_all-features.txt
index 4b7ec462a..80552e2d5 100644
--- a/test/passes/translate-to-fuzz_all-features.txt
+++ b/test/passes/translate-to-fuzz_all-features.txt
@@ -1,8 +1,8 @@
(module
(type $none_=>_none (func))
+ (type $none_=>_i32_anyref_externref (func (result i32 anyref externref)))
(type $f32_=>_none (func (param f32)))
(type $exnref_=>_none (func (param exnref)))
- (type $none_=>_i32_anyref_externref (func (result i32 anyref externref)))
(type $none_=>_externref_anyref_anyref_anyref (func (result externref anyref anyref anyref)))
(type $i32_=>_none (func (param i32)))
(type $i64_=>_none (func (param i64)))
@@ -899,7 +899,7 @@
)
(return
(tuple.make
- (i32.const -91)
+ (i32.const 127)
(ref.null any)
(ref.null extern)
)
@@ -912,7 +912,7 @@
)
)
)
- (block $label$0
+ (block $label$0 (result i32 anyref externref)
(f64.store offset=2
(select
(local.get $1)
@@ -927,7 +927,7 @@
)
(return
(tuple.make
- (i32.const -16383)
+ (i32.const 40)
(ref.null any)
(ref.null extern)
)
@@ -977,7 +977,7 @@
)
(return
(tuple.make
- (i32.const 622862719)
+ (i32.const 1499027801)
(ref.null any)
(ref.null extern)
)
@@ -1000,7 +1000,7 @@
)
(return
(tuple.make
- (i32.const 0)
+ (i32.const -90)
(ref.null any)
(ref.null extern)
)
@@ -1030,7 +1030,7 @@
)
(return
(tuple.make
- (i32.const 25948)
+ (i32.const -88)
(ref.null any)
(ref.null extern)
)
@@ -1103,95 +1103,10 @@
(v128.const i32x4 0x14171109 0x0109440d 0x10031007 0x021d1401)
)
)
- (if
- (local.tee $1
- (local.tee $1
- (block $label$18 (result i32)
- (call $log-f64
- (loop $label$19 (result f64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (tuple.make
- (i32.const -10)
- (ref.null any)
- (ref.null extern)
- )
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result f64)
- (block $label$20
- (call $log-f32
- (block $label$21
- (call $log-i32
- (call $hashMemory)
- )
- (br $label$19)
- )
- )
- (call $log-i32
- (call $hashMemory)
- )
- )
- (br_if $label$19
- (i32.eqz
- (ref.is_null
- (ref.null extern)
- )
- )
- )
- (f64.const 4294967278)
- )
- )
- )
- (i32.atomic.load16_u offset=3
- (i32.and
- (local.get $1)
- (i32.const 15)
- )
- )
- )
- )
- )
- (block $label$1
- (return
- (tuple.make
- (i32.const -131072)
- (ref.null any)
- (ref.null extern)
- )
- )
- )
- (block $label$2
- (i32.atomic.store16 offset=4
- (i32.and
- (local.tee $1
- (local.get $1)
- )
- (i32.const 15)
- )
- (local.tee $1
- (i32.const 843005738)
- )
- )
- (return
- (tuple.make
- (i32.const -8388607)
- (ref.null any)
- (ref.null extern)
- )
- )
- )
+ (tuple.make
+ (i32.const 65534)
+ (ref.null any)
+ (ref.null extern)
)
)
)
diff --git a/test/unit/input/anyref_target_feature.wasm b/test/unit/input/anyref_target_feature.wasm
deleted file mode 100644
index 88c61ebc2..000000000
--- a/test/unit/input/anyref_target_feature.wasm
+++ /dev/null
Binary files differ
diff --git a/test/unit/input/gc_target_feature.wasm b/test/unit/input/gc_target_feature.wasm
new file mode 100644
index 000000000..cd094ca3a
--- /dev/null
+++ 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 2b5b00469..dca3d33b9 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -49,9 +49,9 @@ class FeatureValidationTest(utils.BinaryenTestCase):
['--enable-exception-handling',
'--enable-reference-types'])
- def check_anyref(self, module, error):
- # Anyref handling implies reference types
- self.check_feature(module, error, '--enable-anyref',
+ def check_gc(self, module, error):
+ # GC implies reference types
+ self.check_feature(module, error, '--enable-gc',
['--enable-reference-types'])
def test_v128_signature(self):
@@ -264,7 +264,7 @@ class FeatureValidationTest(utils.BinaryenTestCase):
(global $foo anyref (ref.null any))
)
'''
- self.check_anyref(module, 'all used types should be allowed')
+ self.check_gc(module, 'all used types should be allowed')
def test_anyref_local(self):
module = '''
@@ -274,7 +274,7 @@ class FeatureValidationTest(utils.BinaryenTestCase):
)
)
'''
- self.check_anyref(module, 'all used types should be allowed')
+ self.check_gc(module, 'all used types should be allowed')
class TargetFeaturesSectionTest(utils.BinaryenTestCase):
@@ -333,10 +333,10 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase):
self.check_features(filename, ['exception-handling', 'reference-types'])
self.assertIn('throw', self.disassemble(filename))
- def test_anyref(self):
- filename = 'anyref_target_feature.wasm'
+ def test_gc(self):
+ filename = 'gc_target_feature.wasm'
self.roundtrip(filename)
- self.check_features(filename, ['reference-types', 'anyref'])
+ self.check_features(filename, ['reference-types', 'gc'])
self.assertIn('anyref', self.disassemble(filename))
def test_incompatible_features(self):
@@ -387,5 +387,5 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase):
'--enable-tail-call',
'--enable-reference-types',
'--enable-multivalue',
- '--enable-anyref'
+ '--enable-gc'
], p2.stdout.splitlines())