diff options
author | Alon Zakai <azakai@google.com> | 2021-09-10 09:39:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-10 09:39:10 -0700 |
commit | 3ed93d00b8f7c0d1f4ab2086b386836f2914dc0e (patch) | |
tree | 0511118fad9439fe6995ff0fe1e67b3231b67c14 /test/heap-types.wast.fromBinary | |
parent | 23e452a5c89cc520a1d08bb465785bcb79a43baa (diff) | |
download | binaryen-3ed93d00b8f7c0d1f4ab2086b386836f2914dc0e.tar.gz binaryen-3ed93d00b8f7c0d1f4ab2086b386836f2914dc0e.tar.bz2 binaryen-3ed93d00b8f7c0d1f4ab2086b386836f2914dc0e.zip |
[Wasm GC] ArrayInit support (#4138)
array.init is like array.new_with_rtt except that it takes
as arguments the values to initialize the array with (as opposed to
a size and an optional initial value).
Spec: https://docs.google.com/document/d/1afthjsL_B9UaMqCA5ekgVmOm75BVFu6duHNsN9-gnXw/edit#
Diffstat (limited to 'test/heap-types.wast.fromBinary')
-rw-r--r-- | test/heap-types.wast.fromBinary | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/test/heap-types.wast.fromBinary b/test/heap-types.wast.fromBinary index 74c47eddf..a9bff28f3 100644 --- a/test/heap-types.wast.fromBinary +++ b/test/heap-types.wast.fromBinary @@ -1,23 +1,25 @@ (module (type $struct.A (struct (field i32) (field f32) (field $named f64))) + (type $vector (array (mut f64))) (type $none_=>_none (func)) (type $struct.B (struct (field i8) (field (mut i16)) (field (ref $struct.A)) (field (mut (ref $struct.A))))) - (type $vector (array (mut f64))) (type $grandchild (struct (field i32) (field i64))) (type $matrix (array (mut (ref null $vector)))) (type $struct.C (struct (field $named-mut (mut f32)))) (type $parent (struct )) (type $child (struct (field i32))) + (type $bytes (array (mut i8))) (type $anyref_=>_none (func (param anyref))) (type $nested-child-struct (struct (field (mut (ref $child))))) (type $ref|$struct.A|_=>_ref|$struct.B| (func (param (ref $struct.A)) (result (ref $struct.B)))) (type $ref|$vector|_=>_ref|$matrix| (func (param (ref $vector)) (result (ref $matrix)))) - (type $bytes (array (mut i8))) (type $words (array (mut i32))) (type $nested-child-array (array (mut (ref $child)))) (type $rtt_1_$parent_=>_none (func (param (rtt 1 $parent)))) (type $rtt_$parent_=>_none (func (param (rtt $parent)))) (type $ref|$vector|_ref?|$vector|_=>_none (func (param (ref $vector) (ref null $vector)))) + (type $none_=>_ref|$vector| (func (result (ref $vector)))) + (type $none_=>_ref|$bytes| (func (result (ref $bytes)))) (global $rttparent (rtt 0 $parent) (rtt.canon $parent)) (global $rttchild (rtt 1 $child) (rtt.sub $child (global.get $rttparent) @@ -423,5 +425,22 @@ (i32.const 1337) ) ) + (func $array-init (result (ref $vector)) + (array.init $vector + (f64.const 1) + (f64.const 2) + (f64.const 4) + (f64.const 8) + (rtt.canon $vector) + ) + ) + (func $array-init-packed (result (ref $bytes)) + (array.init $bytes + (i32.const 4) + (i32.const 2) + (i32.const 1) + (rtt.canon $bytes) + ) + ) ) |