summaryrefslogtreecommitdiff
path: root/test/unit/test_features.py
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-02-12 22:47:53 +0000
committerGitHub <noreply@github.com>2021-02-12 14:47:53 -0800
commit60eb7c8c4c76edb89e2d402769c6a3b8450ff7e8 (patch)
tree1039a1f39a96aec26ba76f2b9b7b1239f9cf44e6 /test/unit/test_features.py
parentf826df6e053e0541e16cc19ded8083cf8de7c59d (diff)
downloadbinaryen-60eb7c8c4c76edb89e2d402769c6a3b8450ff7e8.tar.gz
binaryen-60eb7c8c4c76edb89e2d402769c6a3b8450ff7e8.tar.bz2
binaryen-60eb7c8c4c76edb89e2d402769c6a3b8450ff7e8.zip
Allow specifying additional features past the features section (#3564)
That is, if a wasm says "simd", it is ok to let the user specify simd as well as more features, and the the optimizer can perhaps do something with them.
Diffstat (limited to 'test/unit/test_features.py')
-rw-r--r--test/unit/test_features.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/unit/test_features.py b/test/unit/test_features.py
index 7eb814e39..9c3b20ed7 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -349,6 +349,13 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase):
self.assertIn('anyref', disassembly)
self.assertIn('eqref', disassembly)
+ def test_superset(self):
+ # It is ok to enable additional features past what is in the section.
+ shared.run_process(
+ shared.WASM_OPT + ['--print', '--detect-features', '-mvp',
+ '--enable-simd', '--enable-sign-ext',
+ self.input_path('signext_target_feature.wasm')])
+
def test_incompatible_features(self):
path = self.input_path('signext_target_feature.wasm')
p = shared.run_process(
@@ -357,7 +364,7 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase):
check=False, capture_output=True
)
self.assertNotEqual(p.returncode, 0)
- self.assertIn('Fatal: module features do not match specified features. ' +
+ self.assertIn('Fatal: features section is not a subset of specified features. ' +
'Use --detect-features to resolve.',
p.stderr)