summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-07-08 11:35:03 -0700
committerGitHub <noreply@github.com>2022-07-08 18:35:03 +0000
commit838e8eed2cea3d7818b19620cdca732b8b05dfca (patch)
tree95319cb32e611a56c43de3041f5e4c65d99f9f4f /test
parent06c50a47994e60a2730df140dfada94e2a08fb38 (diff)
downloadbinaryen-838e8eed2cea3d7818b19620cdca732b8b05dfca.tar.gz
binaryen-838e8eed2cea3d7818b19620cdca732b8b05dfca.tar.bz2
binaryen-838e8eed2cea3d7818b19620cdca732b8b05dfca.zip
[Parser] Parse standard subtype declarations (#4778)
Parse type definitions with the format `(type $t (sub $super ...))`. Update the test to use hybrid types so that the subtypes are reflected in the test output.
Diffstat (limited to 'test')
-rw-r--r--test/lit/wat-kitchen-sink.wast44
1 files changed, 28 insertions, 16 deletions
diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast
index 1520003a6..315cb172c 100644
--- a/test/lit/wat-kitchen-sink.wast
+++ b/test/lit/wat-kitchen-sink.wast
@@ -1,43 +1,49 @@
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
-;; RUN: wasm-opt --new-wat-parser -all %s -S -o - | filecheck %s
+;; RUN: wasm-opt --new-wat-parser --hybrid -all %s -S -o - | filecheck %s
(module $parse
;; types
- ;; CHECK: (type $s0 (struct ))
+ ;; CHECK: (type $s0 (struct_subtype data))
- ;; CHECK: (type $void (func))
+ ;; CHECK: (type $void (func_subtype func))
(type $void (func))
- ;; CHECK: (type $many (func (param i32 i64 f32 f64) (result anyref (ref func))))
+ ;; CHECK: (type $many (func_subtype (param i32 i64 f32 f64) (result anyref (ref func)) func))
(type $many (func (param $x i32) (param i64 f32) (param) (param $y f64)
(result anyref (ref func))))
- (type $s0 (struct))
+ (type $s0 (sub (struct)))
(type $s1 (struct (field)))
- ;; CHECK: (type $s2 (struct (field i32)))
+ ;; CHECK: (type $s2 (struct_subtype (field i32) data))
(type $s2 (struct i32))
- ;; CHECK: (type $s3 (struct (field i64)))
+ ;; CHECK: (type $s3 (struct_subtype (field i64) data))
(type $s3 (struct (field i64)))
- ;; CHECK: (type $s4 (struct (field $x f32)))
+ ;; CHECK: (type $s4 (struct_subtype (field $x f32) data))
(type $s4 (struct (field $x f32)))
- ;; CHECK: (type $s5 (struct (field i32) (field i64)))
+ ;; CHECK: (type $s5 (struct_subtype (field i32) (field i64) data))
(type $s5 (struct i32 i64))
- ;; CHECK: (type $s6 (struct (field i64) (field f32)))
+ ;; CHECK: (type $s6 (struct_subtype (field i64) (field f32) data))
(type $s6 (struct (field i64 f32)))
- ;; CHECK: (type $s7 (struct (field $x f32) (field $y f64)))
+ ;; CHECK: (type $s7 (struct_subtype (field $x f32) (field $y f64) data))
(type $s7 (struct (field $x f32) (field $y f64)))
- ;; CHECK: (type $s8 (struct (field i32) (field i64) (field $z f32) (field f64) (field (mut i32))))
+ ;; CHECK: (type $s8 (struct_subtype (field i32) (field i64) (field $z f32) (field f64) (field (mut i32)) data))
(type $s8 (struct i32 (field) i64 (field $z f32) (field f64 (mut i32))))
- ;; CHECK: (type $a0 (array i32))
+ ;; CHECK: (type $a0 (array_subtype i32 data))
(type $a0 (array i32))
- ;; CHECK: (type $a1 (array i64))
+ ;; CHECK: (type $a1 (array_subtype i64 data))
(type $a1 (array (field i64)))
- ;; CHECK: (type $a2 (array (mut f32)))
+ ;; CHECK: (type $a2 (array_subtype (mut f32) data))
(type $a2 (array (mut f32)))
- ;; CHECK: (type $a3 (array (mut f64)))
+ ;; CHECK: (type $a3 (array_subtype (mut f64) data))
(type $a3 (array (field $x (mut f64))))
+ ;; CHECK: (type $subvoid (func_subtype $void))
+ (type $subvoid (sub 0 (func)))
+
+ ;; CHECK: (type $submany (func_subtype (param i32 i64 f32 f64) (result anyref (ref func)) $many))
+ (type $submany (sub $many (func (param i32 i64 f32 f64) (result anyref (ref func)))))
+
;; globals
(global $g1 (export "g1") (export "g1.1") (import "mod" "g1") i32)
(global $g2 (import "mod" "g2") (mut i64))
@@ -59,6 +65,8 @@
(global $a1 (import "mod" "a1") (mut (ref $a1)))
(global $a2 (import "mod" "a2") (mut (ref $a2)))
(global $a3 (import "mod" "a3") (mut (ref $a3)))
+ (global $sub0 (import "mod" "sub0") (mut (ref $subvoid)))
+ (global $sub1 (import "mod" "sub1") (mut (ref $submany)))
)
;; CHECK: (import "mod" "g1" (global $g1 i32))
@@ -94,6 +102,10 @@
;; CHECK: (import "mod" "a3" (global $a3 (mut (ref $a3))))
+;; CHECK: (import "mod" "sub0" (global $sub0 (mut (ref $subvoid))))
+
+;; CHECK: (import "mod" "sub1" (global $sub1 (mut (ref $submany))))
+
;; CHECK: (export "g1" (global $g1))
;; CHECK: (export "g1.1" (global $g1))