summaryrefslogtreecommitdiff
path: root/test/parse/module
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2020-03-16 17:24:37 -0700
committerGitHub <noreply@github.com>2020-03-16 17:24:37 -0700
commit5467faf5cd52ba2da3e331e6c950a3860c559010 (patch)
tree9531fd3cdce64776c1713fff52782073f4d7934b /test/parse/module
parent261dfdd75d8199298c9e0143e351322cc79c996a (diff)
downloadwabt-5467faf5cd52ba2da3e331e6c950a3860c559010.tar.gz
wabt-5467faf5cd52ba2da3e331e6c950a3860c559010.tar.bz2
wabt-5467faf5cd52ba2da3e331e6c950a3860c559010.zip
Parse struct fields (#1355)
This allows the following field formats: * `(struct (field $name i32))` * `(struct (field $name (mut i32)))` * `(struct (field i32))` * `(struct (field (mut i32)))` * `(struct (mut i32))` * `(struct i32)`
Diffstat (limited to 'test/parse/module')
-rw-r--r--test/parse/module/struct-and-func.txt7
-rw-r--r--test/parse/module/struct-field-name.txt5
-rw-r--r--test/parse/module/struct-mut-field.txt3
-rw-r--r--test/parse/module/struct.txt2
4 files changed, 16 insertions, 1 deletions
diff --git a/test/parse/module/struct-and-func.txt b/test/parse/module/struct-and-func.txt
new file mode 100644
index 00000000..93a524e1
--- /dev/null
+++ b/test/parse/module/struct-and-func.txt
@@ -0,0 +1,7 @@
+;;; TOOL: wat2wasm
+;;; ARGS: --enable-gc
+(type (struct i32 i32))
+(type (func (result i32)))
+
+(func (result i32)
+ i32.const 0)
diff --git a/test/parse/module/struct-field-name.txt b/test/parse/module/struct-field-name.txt
new file mode 100644
index 00000000..ea42514e
--- /dev/null
+++ b/test/parse/module/struct-field-name.txt
@@ -0,0 +1,5 @@
+;;; TOOL: wat2wasm
+;;; ARGS: --enable-gc
+(type
+ (struct (field $a f32)
+ (field $b (mut f64))))
diff --git a/test/parse/module/struct-mut-field.txt b/test/parse/module/struct-mut-field.txt
new file mode 100644
index 00000000..8189179a
--- /dev/null
+++ b/test/parse/module/struct-mut-field.txt
@@ -0,0 +1,3 @@
+;;; TOOL: wat2wasm
+;;; ARGS: --enable-gc
+(type (struct (mut f32) (field (mut f64))))
diff --git a/test/parse/module/struct.txt b/test/parse/module/struct.txt
index e199a0ce..825e9d67 100644
--- a/test/parse/module/struct.txt
+++ b/test/parse/module/struct.txt
@@ -1,3 +1,3 @@
;;; TOOL: wat2wasm
;;; ARGS: --enable-gc
-(type (struct))
+(type (struct i32 (field i64)))