diff options
Diffstat (limited to 'test/unit/test_features.py')
-rw-r--r-- | test/unit/test_features.py | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/test/unit/test_features.py b/test/unit/test_features.py index f5c3fabc5..c115719e7 100644 --- a/test/unit/test_features.py +++ b/test/unit/test_features.py @@ -30,6 +30,9 @@ class FeatureValidationTest(utils.BinaryenTestCase): def check_bulk_mem(self, module, error): self.check_feature(module, error, '--enable-bulk-memory') + def check_bulk_mem_opt(self, module, error): + self.check_feature(module, error, '--enable-bulk-memory-opt') + def check_exception_handling(self, module, error): self.check_feature(module, error, '--enable-exception-handling') @@ -135,8 +138,11 @@ class FeatureValidationTest(utils.BinaryenTestCase): ) ) ''' + self.check_bulk_mem_opt(module, + 'memory.copy operations require bulk memory operations [--enable-bulk-memory-opt]') + # Test that enabling bulk-memory also enables bulk-memory-opt self.check_bulk_mem(module, - 'Bulk memory operations require bulk memory [--enable-bulk-memory]') + 'memory.copy operations require bulk memory operations [--enable-bulk-memory-opt]') def test_bulk_mem_segment(self): module = ''' @@ -306,6 +312,23 @@ class FeatureValidationTest(utils.BinaryenTestCase): ''' self.check_typed_continuations(module, 'all used types should be allowed') + def test_call_indirect_overlong(self): + # Check that the call-indirect-overlong enable and disable are ignored. + module = ''' + (module) + ''' + + def check_nop(flag): + p = shared.run_process( + shared.WASM_OPT + ['--mvp-features', '--print', '-o', os.devnull] + + [flag], + input=module, + check=False, + capture_output=True) + self.assertEqual(p.returncode, 0) + check_nop('--enable-call-indirect-overlong') + check_nop('--disable-call-indirect-overlong') + class TargetFeaturesSectionTest(utils.BinaryenTestCase): def test_atomics(self): @@ -314,10 +337,10 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase): self.check_features(filename, ['threads']) self.assertIn('i32.atomic.rmw.add', self.disassemble(filename)) - def test_bulk_memory(self): + def test_bulk_memory_opt(self): filename = 'bulkmem_target_feature.wasm' self.roundtrip(filename) - self.check_features(filename, ['bulk-memory']) + self.check_features(filename, ['bulk-memory-opt']) self.assertIn('memory.copy', self.disassemble(filename)) def test_nontrapping_fptoint(self): @@ -427,4 +450,5 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase): '--enable-typed-continuations', '--enable-shared-everything', '--enable-fp16', + '--enable-bulk-memory-opt', ], p2.stdout.splitlines()) |