summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-03-01 22:14:58 +0000
committerGitHub <noreply@github.com>2021-03-01 14:14:58 -0800
commit1f0ab5b54850812040b2e9f56a3428aeac54e425 (patch)
tree19a48e984efb6a821f12da4d627e2fcd653cf593 /test
parent101aac786ccffe3714fdcf05437b2b740135b4de (diff)
downloadbinaryen-1f0ab5b54850812040b2e9f56a3428aeac54e425.tar.gz
binaryen-1f0ab5b54850812040b2e9f56a3428aeac54e425.tar.bz2
binaryen-1f0ab5b54850812040b2e9f56a3428aeac54e425.zip
[Wasm GC] Add Names section support for field names (#3589)
Adds support for GC struct fields in the binary format, implementing WebAssembly/gc#193 No extra tests needed, see the .fromBinary output which shows this working. This also has a minor fix in the s-parser, we should not always add a name to the map of index=>name - only if it exists. Without that fix, the binary emitter would write out null strings.
Diffstat (limited to 'test')
-rw-r--r--test/heap-types.wast.fromBinary10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/heap-types.wast.fromBinary b/test/heap-types.wast.fromBinary
index 75dcae823..2fe6adbe1 100644
--- a/test/heap-types.wast.fromBinary
+++ b/test/heap-types.wast.fromBinary
@@ -1,11 +1,11 @@
(module
- (type $struct.A (struct (field i32) (field f32) (field f64)))
+ (type $struct.A (struct (field i32) (field f32) (field $named f64)))
(type $struct.B (struct (field i8) (field (mut i16)) (field (ref null $struct.A)) (field (mut (ref null $struct.A)))))
(type $matrix (array (ref null $vector)))
(type $vector (array (mut f64)))
(type $anyref_=>_none (func (param anyref)))
(type $parent (struct ))
- (type $struct.C (struct (field (mut f32))))
+ (type $struct.C (struct (field $named-mut (mut f32))))
(type $none_=>_none (func))
(type $rtt_1_$parent_=>_none (func (param (rtt 1 $parent))))
(type $rtt_$parent_=>_none (func (param (rtt $parent))))
@@ -42,12 +42,12 @@
)
)
(drop
- (struct.get $struct.A 2
+ (struct.get $struct.A $named
(local.get $x)
)
)
(drop
- (struct.get $struct.A 2
+ (struct.get $struct.A $named
(local.get $x)
)
)
@@ -88,7 +88,7 @@
(i32.const 1)
)
)
- (struct.set $struct.C 0
+ (struct.set $struct.C $named-mut
(ref.null $struct.C)
(f32.const 100)
)