summaryrefslogtreecommitdiff
path: root/test/heap-types.wast.fromBinary
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-12-05 15:49:34 -0800
committerGitHub <noreply@github.com>2020-12-05 15:49:34 -0800
commit18cf8a7557e34f722704c294f3d95817bac8cfc0 (patch)
treee1c6f0edecb13c8e5710a134e737cfebe0cc224e /test/heap-types.wast.fromBinary
parent51dfeef750acacea8dd1331213aa87ae76423dea (diff)
downloadbinaryen-18cf8a7557e34f722704c294f3d95817bac8cfc0.tar.gz
binaryen-18cf8a7557e34f722704c294f3d95817bac8cfc0.tar.bz2
binaryen-18cf8a7557e34f722704c294f3d95817bac8cfc0.zip
[GC] Support reading and writing of Struct and Array types (#3423)
This adds support in the text and binary format handling, which allows us to have a full test of reading and writing the types. This also adds a "name" field to struct fields, which the text format supports.
Diffstat (limited to 'test/heap-types.wast.fromBinary')
-rw-r--r--test/heap-types.wast.fromBinary18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/heap-types.wast.fromBinary b/test/heap-types.wast.fromBinary
new file mode 100644
index 000000000..e83d6bbb4
--- /dev/null
+++ b/test/heap-types.wast.fromBinary
@@ -0,0 +1,18 @@
+(module
+ (type ${i32_f32_f64} (struct (field i32) (field f32) (field f64)))
+ (type $[mut:f64] (array (mut f64)))
+ (type ${mut:f32} (struct (field (mut f32))))
+ (type ${mut:i64_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|} (struct (field (mut i64)) (field (ref null ${i32_f32_f64})) (field (mut (ref null ${i32_f32_f64})))))
+ (type $[ref?|[mut:f64]|] (array (ref null $[mut:f64])))
+ (type $ref?|{i32_f32_f64}|_=>_ref?|{mut:i64_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|}| (func (param (ref null ${i32_f32_f64})) (result (ref null ${mut:i64_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|}))))
+ (export "foo" (func $0))
+ (func $0 (param $x (ref null ${i32_f32_f64})) (result (ref null ${mut:i64_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|}))
+ (local $1 (ref null ${i32_f32_f64}))
+ (local $2 (ref null ${mut:i64_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|}))
+ (local $3 (ref null ${mut:f32}))
+ (local $4 (ref null $[ref?|[mut:f64]|]))
+ (local $5 (ref null $[mut:f64]))
+ (unreachable)
+ )
+)
+