diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/binaryen.js/kitchen-sink.js | 13 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 4 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 10 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 4 |
4 files changed, 15 insertions, 16 deletions
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index 38ce32876..649abfa4b 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -63,6 +63,7 @@ function test_types() { } function test_features() { + console.log("Binaryen.Features.MVP: " + Binaryen.Features.MVP); console.log("Binaryen.Features.Atomics: " + Binaryen.Features.Atomics); console.log("Binaryen.Features.BulkMemory: " + Binaryen.Features.BulkMemory); console.log("Binaryen.Features.MutableGlobals: " + Binaryen.Features.MutableGlobals); @@ -70,6 +71,7 @@ function test_features() { console.log("Binaryen.Features.SignExt: " + Binaryen.Features.SignExt); console.log("Binaryen.Features.SIMD128: " + Binaryen.Features.SIMD128); console.log("Binaryen.Features.ExceptionHandling: " + Binaryen.Features.ExceptionHandling); + console.log("Binaryen.Features.All: " + Binaryen.Features.All); } function test_ids() { @@ -464,13 +466,7 @@ function test_core() { // A bunch of our code needs drop, auto-add it module.autoDrop(); - var features = - Binaryen.Features.Atomics | - Binaryen.Features.BulkMemory | - Binaryen.Features.NontrappingFPToInt | - Binaryen.Features.SignExt | - Binaryen.Features.SIMD128; - + var features = Binaryen.Features.All; module.setFeatures(features); assert(module.getFeatures() == features); @@ -759,6 +755,9 @@ function test_parsing() { // create a module and write it to text module = new Binaryen.Module(); + + module.setFeatures(Binaryen.Features.All); + var iii = module.addFunctionType("iii", Binaryen.i32, [ Binaryen.i32, Binaryen.i32 ]); var x = module.local.get(0, Binaryen.i32), y = module.local.get(1, Binaryen.i32); diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index e68efda08..857950e6b 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -7,6 +7,7 @@ BinaryenTypeVec128: 5 BinaryenTypeExceptRef: 6 BinaryenTypeUnreachable: 7 BinaryenTypeAuto: -1 +Binaryen.Features.MVP: 0 Binaryen.Features.Atomics: 1 Binaryen.Features.BulkMemory: 16 Binaryen.Features.MutableGlobals: 2 @@ -14,6 +15,7 @@ Binaryen.Features.NontrappingFPToInt: 4 Binaryen.Features.SignExt: 32 Binaryen.Features.SIMD128: 8 Binaryen.Features.ExceptionHandling: 64 +Binaryen.Features.All: 127 BinaryenInvalidId: 0 BinaryenBlockId: 1 BinaryenIfId: 2 @@ -3390,7 +3392,7 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5} functionTypes[3] = BinaryenAddFunctionType(the_module, NULL, 0, paramTypes, 0); } BinaryenModuleAutoDrop(the_module); - BinaryenModuleSetFeatures(the_module, 61); + BinaryenModuleSetFeatures(the_module, 127); BinaryenModuleGetFeatures(the_module); BinaryenModuleValidate(the_module); BinaryenModulePrint(the_module); diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 43069c865..e0b4a5ec4 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -161,6 +161,7 @@ void test_types() { } void test_features() { + printf("BinaryenFeatureMVP: %d\n", BinaryenFeatureMVP()); printf("BinaryenFeatureAtomics: %d\n", BinaryenFeatureAtomics()); printf("BinaryenFeatureBulkMemory: %d\n", BinaryenFeatureBulkMemory()); printf("BinaryenFeatureMutableGlobals: %d\n", BinaryenFeatureMutableGlobals()); @@ -168,6 +169,7 @@ void test_features() { printf("BinaryenFeatureSignExt: %d\n", BinaryenFeatureSignExt()); printf("BinaryenFeatureSIMD128: %d\n", BinaryenFeatureSIMD128()); printf("BinaryenFeatureExceptionHandling: %d\n", BinaryenFeatureExceptionHandling()); + printf("BinaryenFeatureAll: %d\n", BinaryenFeatureAll()); } void test_core() { @@ -521,13 +523,7 @@ void test_core() { // A bunch of our code needs drop(), auto-add it BinaryenModuleAutoDrop(module); - BinaryenFeatures features = - BinaryenFeatureAtomics() | - BinaryenFeatureBulkMemory() | - BinaryenFeatureNontrappingFPToInt() | - BinaryenFeatureSignExt() | - BinaryenFeatureSIMD128(); - + BinaryenFeatures features = BinaryenFeatureAll(); BinaryenModuleSetFeatures(module, features); assert(BinaryenModuleGetFeatures(module) == features); diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index f1eba84b7..c9bcc4b68 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -7,6 +7,7 @@ BinaryenTypeVec128: 5 BinaryenTypeExceptRef: 6 BinaryenTypeUnreachable: 7 BinaryenTypeAuto: -1 +BinaryenFeatureMVP: 0 BinaryenFeatureAtomics: 1 BinaryenFeatureBulkMemory: 16 BinaryenFeatureMutableGlobals: 2 @@ -14,6 +15,7 @@ BinaryenFeatureNontrappingFPToInt: 4 BinaryenFeatureSignExt: 32 BinaryenFeatureSIMD128: 8 BinaryenFeatureExceptionHandling: 64 +BinaryenFeatureAll: 127 (f32.neg (f32.const -33.61199951171875) ) @@ -3341,7 +3343,7 @@ int main() { functionTypes[3] = BinaryenAddFunctionType(the_module, NULL, 0, paramTypes, 0); } BinaryenModuleAutoDrop(the_module); - BinaryenModuleSetFeatures(the_module, 61); + BinaryenModuleSetFeatures(the_module, 127); BinaryenModuleGetFeatures(the_module); BinaryenModuleValidate(the_module); BinaryenModulePrint(the_module); |