summaryrefslogtreecommitdiff
path: root/test/unit/test_features.py
diff options
context:
space:
mode:
authorFrank Emrich <git@emrich.io>2023-10-25 00:16:12 +0100
committerGitHub <noreply@github.com>2023-10-24 16:16:12 -0700
commit02e5b160a1625ca8e2bf24bff9b4e06d012cf417 (patch)
tree0763490e387856d2cc62eb9a93d3a8d01996b3ec /test/unit/test_features.py
parentec8220f4aa556ce39145db13eddd84855b11f76c (diff)
downloadbinaryen-02e5b160a1625ca8e2bf24bff9b4e06d012cf417.tar.gz
binaryen-02e5b160a1625ca8e2bf24bff9b4e06d012cf417.tar.bz2
binaryen-02e5b160a1625ca8e2bf24bff9b4e06d012cf417.zip
Typed Continuations: Add cont type (#5998)
This PR is part of a series that adds basic support for the [typed continuations proposal](https://github.com/wasmfx/specfx). This PR adds continuation types, of the form `(cont $foo)` for some function type `$foo`. The only notable changes affecting existing code are the following: - This is the first `HeapType` which has another `HeapType` (rather than, say, a `Type`) as its immediate child. This required fixes to certain traversals that have a flag for being at the toplevel of a type. - Some shared logic for parsing `HeapType`s has been factored out.
Diffstat (limited to 'test/unit/test_features.py')
-rw-r--r--test/unit/test_features.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/test_features.py b/test/unit/test_features.py
index d2d72a8e4..cd8aebbb1 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -294,6 +294,18 @@ class FeatureValidationTest(utils.BinaryenTestCase):
'Tags with result types require typed '
'continuations feature [--enable-typed-continuations]')
+ def test_cont_type(self):
+ module = '''
+ (module
+ (type $ft (func (param i32) (result i32)))
+ (type $ct (cont $ft))
+ (func $foo
+ (local $0 (ref $ct))
+ )
+ )
+ '''
+ self.check_typed_continuations(module, 'all used types should be allowed')
+
class TargetFeaturesSectionTest(utils.BinaryenTestCase):
def test_atomics(self):