summaryrefslogtreecommitdiff
path: root/test/unit/test_features.py
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-12-30 17:55:20 -0800
committerGitHub <noreply@github.com>2019-12-30 17:55:20 -0800
commitbcc76146fed433cbc8ba01a9f568d979c145110b (patch)
treeab70ad24afc257b73513c3e62f3aab9938d05944 /test/unit/test_features.py
parenta30f1df5696ccb3490e2eaa3a9ed5e7e487c7b0e (diff)
downloadbinaryen-bcc76146fed433cbc8ba01a9f568d979c145110b.tar.gz
binaryen-bcc76146fed433cbc8ba01a9f568d979c145110b.tar.bz2
binaryen-bcc76146fed433cbc8ba01a9f568d979c145110b.zip
Add support for reference types proposal (#2451)
This adds support for the reference type proposal. This includes support for all reference types (`anyref`, `funcref`(=`anyfunc`), and `nullref`) and four new instructions: `ref.null`, `ref.is_null`, `ref.func`, and new typed `select`. This also adds subtype relationship support between reference types. This does not include table instructions yet. This also does not include wasm2js support. Fixes #2444 and fixes #2447.
Diffstat (limited to 'test/unit/test_features.py')
-rw-r--r--test/unit/test_features.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/test/unit/test_features.py b/test/unit/test_features.py
index dece97ec5..e0a3064d5 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -12,29 +12,34 @@ class FeatureValidationTest(utils.BinaryenTestCase):
self.assertIn(error, p.stderr)
self.assertIn('Fatal: error in validating input', p.stderr)
self.assertNotEqual(p.returncode, 0)
- p = shared.run_process(shared.WASM_OPT +
- ['--mvp-features', flag, '--print', '-o',
- os.devnull],
- input=module, check=False, capture_output=True)
+ 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)
def check_simd(self, module, error):
- self.check_feature(module, error, '--enable-simd')
+ self.check_feature(module, error, ['--enable-simd'])
def check_sign_ext(self, module, error):
- self.check_feature(module, error, '--enable-sign-ext')
+ self.check_feature(module, error, ['--enable-sign-ext'])
def check_bulk_mem(self, module, error):
- self.check_feature(module, error, '--enable-bulk-memory')
+ self.check_feature(module, error, ['--enable-bulk-memory'])
def check_exception_handling(self, module, error):
- self.check_feature(module, error, '--enable-exception-handling')
+ # Exception handling implies reference types
+ self.check_feature(module, error,
+ ['--enable-reference-types',
+ '--enable-exception-handling'])
def check_tail_call(self, module, error):
- self.check_feature(module, error, '--enable-tail-call')
+ self.check_feature(module, error, ['--enable-tail-call'])
def check_reference_types(self, module, error):
- self.check_feature(module, error, '--enable-reference-types')
+ self.check_feature(module, error, ['--enable-reference-types'])
def test_v128_signature(self):
module = '''