diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/binaryen.js/kitchen-sink.js | 2 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 2 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 2 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 2 | ||||
-rw-r--r-- | test/passes/strip-target-features_roundtrip_print-features_all-features.txt | 2 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz_all-features.txt | 107 | ||||
-rw-r--r-- | test/unit/input/anyref_target_feature.wasm | bin | 60 -> 0 bytes | |||
-rw-r--r-- | test/unit/input/gc_target_feature.wasm | bin | 0 -> 56 bytes | |||
-rw-r--r-- | test/unit/test_features.py | 18 |
9 files changed, 25 insertions, 110 deletions
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 Binary files differdeleted file mode 100644 index 88c61ebc2..000000000 --- a/test/unit/input/anyref_target_feature.wasm +++ /dev/null diff --git a/test/unit/input/gc_target_feature.wasm b/test/unit/input/gc_target_feature.wasm Binary files differnew file mode 100644 index 000000000..cd094ca3a --- /dev/null +++ b/test/unit/input/gc_target_feature.wasm 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()) |