summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorFrank Emrich <git@emrich.io>2023-10-05 18:25:59 +0100
committerGitHub <noreply@github.com>2023-10-05 10:25:59 -0700
commit67804305e680ffcf6b3bbcb4b56a1c31c284c3d0 (patch)
tree463b61e61ecc7c0e914d6822cea4a079af9fd1db /test/unit
parent5597ad587857f5f20b23fbd45a94abd98deaf25c (diff)
downloadbinaryen-67804305e680ffcf6b3bbcb4b56a1c31c284c3d0.tar.gz
binaryen-67804305e680ffcf6b3bbcb4b56a1c31c284c3d0.tar.bz2
binaryen-67804305e680ffcf6b3bbcb4b56a1c31c284c3d0.zip
[typed-cont] Allow result types on tags (#5997)
This PR is part of a series that adds basic support for the typed continuations proposal. This PR relaxes the restriction that tags must not have results , only params. Tags with results must not be used for exception handling and are only allowed if the typed continuations feature is enabled. As a minor point, this PR also changes the printing of tags without params: To make the presentation consistent, (param) is omitted when printing a tag.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_features.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/test_features.py b/test/unit/test_features.py
index cbdae1c56..d2d72a8e4 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -51,6 +51,12 @@ class FeatureValidationTest(utils.BinaryenTestCase):
self.check_feature(module, error, '--enable-gc',
['--enable-reference-types'])
+ def check_typed_continuations(self, module, error):
+ # Typed continuations implies function references (which is provided by
+ # gc in binaryen, and implies reference types) and exceptions
+ self.check_feature(module, error, '--enable-typed-continuations',
+ ['--enable-gc', '--enable-reference-types', '--enable-exception-handling'])
+
def test_v128_signature(self):
module = '''
(module
@@ -278,6 +284,16 @@ class FeatureValidationTest(utils.BinaryenTestCase):
'''
self.check_gc(module, 'all used types should be allowed')
+ def test_tag_results(self):
+ module = '''
+ (module
+ (tag $foo (result i32))
+ )
+ '''
+ self.check_typed_continuations(module,
+ 'Tags with result types require typed '
+ 'continuations feature [--enable-typed-continuations]')
+
class TargetFeaturesSectionTest(utils.BinaryenTestCase):
def test_atomics(self):