summaryrefslogtreecommitdiff
path: root/test/heap-types.wast.fromBinary
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-05-27 12:53:05 -0700
committerGitHub <noreply@github.com>2021-05-27 12:53:05 -0700
commit97f37aa13ce3ed318dc18980f03c41e7536624a5 (patch)
treee192a2c89442cdbae8f16f481c32434b00a376a7 /test/heap-types.wast.fromBinary
parent27a18f990e022cfe5b6a5485fd2eaca73b6dfbaa (diff)
downloadbinaryen-97f37aa13ce3ed318dc18980f03c41e7536624a5.tar.gz
binaryen-97f37aa13ce3ed318dc18980f03c41e7536624a5.tar.bz2
binaryen-97f37aa13ce3ed318dc18980f03c41e7536624a5.zip
[Wasm GC] Add experimental array.copy (#3911)
Spec for it is here: https://docs.google.com/document/d/1DklC3qVuOdLHSXB5UXghM_syCh-4cMinQ50ICiXnK3Q/edit# Also reorder some things in wasm.h that were not in the canonical order (that has no effect, but it is confusing to read).
Diffstat (limited to 'test/heap-types.wast.fromBinary')
-rw-r--r--test/heap-types.wast.fromBinary12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/heap-types.wast.fromBinary b/test/heap-types.wast.fromBinary
index 591be6431..dbe080996 100644
--- a/test/heap-types.wast.fromBinary
+++ b/test/heap-types.wast.fromBinary
@@ -1,8 +1,8 @@
(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))))
@@ -17,6 +17,7 @@
(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))))
(global $rttparent (rtt 0 $parent) (rtt.canon $parent))
(global $rttchild (rtt 1 $child) (rtt.sub $child
(global.get $rttparent)
@@ -348,5 +349,14 @@
)
(unreachable)
)
+ (func $array-copy (param $x (ref $vector)) (param $y (ref null $vector))
+ (array.copy $vector $vector
+ (local.get $x)
+ (i32.const 11)
+ (local.get $y)
+ (i32.const 42)
+ (i32.const 1337)
+ )
+ )
)