diff options
author | Alon Zakai <azakai@google.com> | 2021-09-23 12:36:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-23 12:36:17 -0700 |
commit | 675295888609a688ee81dc9ad2024169da5aa7ed (patch) | |
tree | 796dc5d72867300f97ab234e40729ae6b7db2875 /test/heap-types.wast.fromBinary | |
parent | 6d46b436b54bdae040a64bd9dafb01a7f53a8233 (diff) | |
download | binaryen-675295888609a688ee81dc9ad2024169da5aa7ed.tar.gz binaryen-675295888609a688ee81dc9ad2024169da5aa7ed.tar.bz2 binaryen-675295888609a688ee81dc9ad2024169da5aa7ed.zip |
[Wasm GC] Implement static (rtt-free) StructNew, ArrayNew, ArrayInit (#4172)
See #4149
This modifies the test added in #4163 which used static casts on
dynamically-created structs and arrays. That was technically not
valid (as we won't want users to "mix" the two forms). This makes that
test 100% static, which both fixes the test and gives test coverage
to the new instructions added here.
Diffstat (limited to 'test/heap-types.wast.fromBinary')
-rw-r--r-- | test/heap-types.wast.fromBinary | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/test/heap-types.wast.fromBinary b/test/heap-types.wast.fromBinary index 7ac581848..f6b364b14 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 $struct.B (struct (field i8) (field (mut i16)) (field (ref $struct.A)) (field (mut (ref $struct.A))))) - (type $none_=>_none (func)) (type $vector (array (mut f64))) + (type $none_=>_none (func)) (type $grandchild (struct (field i32) (field i64))) (type $matrix (array (mut (ref null $vector)))) (type $struct.C (struct (field $named-mut (mut f32)))) @@ -476,5 +476,36 @@ ) ) ) + (func $static-constructions + (drop + (struct.new_default $struct.A) + ) + (drop + (struct.new $struct.A + (i32.const 1) + (f32.const 2.3450000286102295) + (f64.const 3.14159) + ) + ) + (drop + (array.new $vector + (f64.const 3.14159) + (i32.const 3) + ) + ) + (drop + (array.new_default $matrix + (i32.const 10) + ) + ) + (drop + (array.init_static $vector + (f64.const 1) + (f64.const 2) + (f64.const 4) + (f64.const 8) + ) + ) + ) ) |