diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2022-06-13 19:47:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-14 02:47:24 +0000 |
commit | 0657f612ce6fcbe8165d9f41c3e730273a9c7c64 (patch) | |
tree | 4d45bfd79b7b2342f346601e9df9cfa381d58184 /test | |
parent | 093bf06e1115e84c4300eca91197dc31336ee3e5 (diff) | |
download | binaryen-0657f612ce6fcbe8165d9f41c3e730273a9c7c64.tar.gz binaryen-0657f612ce6fcbe8165d9f41c3e730273a9c7c64.tar.bz2 binaryen-0657f612ce6fcbe8165d9f41c3e730273a9c7c64.zip |
[Parser] Parse function types (#4718)
Begin implementing the second phase of parsing, parsing of type definitions.
Extend `valtype` to parse both user-defined and built in ref types, add `type`
as a top-level module field, and implement parsers for params, results, and
functype definitions.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/wat-kitchen-sink.wast | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast index 90d5d5b41..4b5ec740b 100644 --- a/test/lit/wat-kitchen-sink.wast +++ b/test/lit/wat-kitchen-sink.wast @@ -3,16 +3,27 @@ ;; RUN: wasm-opt --new-wat-parser -all %s -S -o - | filecheck %s (module $parse + ;; types + ;; CHECK: (type $void (func)) + (type $void (func)) + ;; CHECK: (type $many (func (param i32 i64 f32 f64) (result anyref (ref func)))) + (type $many (func (param $x i32) (param i64 f32) (param) (param $y f64) + (result anyref (ref func)))) ;; globals (global $g1 (export "g1") (export "g1.1") (import "mod" "g1") i32) (global $g2 (import "mod" "g2") (mut i64)) - + (global (import "" "g3") (ref 0)) + (global (import "mod" "") (ref null $many)) ) ;; CHECK: (import "mod" "g1" (global $g1 i32)) ;; CHECK: (import "mod" "g2" (global $g2 (mut i64))) +;; CHECK: (import "" "g3" (global $gimport$0 (ref $void))) + +;; CHECK: (import "mod" "" (global $gimport$1 (ref null $many))) + ;; CHECK: (export "g1" (global $g1)) ;; CHECK: (export "g1.1" (global $g1)) |