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/lit/passes/precompute-gc.wast | |
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/lit/passes/precompute-gc.wast')
-rw-r--r-- | test/lit/passes/precompute-gc.wast | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lit/passes/precompute-gc.wast b/test/lit/passes/precompute-gc.wast index 0a08c02c0..44eff1c5f 100644 --- a/test/lit/passes/precompute-gc.wast +++ b/test/lit/passes/precompute-gc.wast @@ -510,4 +510,24 @@ ) ) ) + + ;; CHECK: (func $new_block_unreachable (result anyref) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (rtt.canon $struct) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $new_block_unreachable (result anyref) + (struct.new_with_rtt $struct + ;; The value is a block with an unreachable. precompute will get rid of the + ;; block, after which fuzz-exec should not crash - this is a regression test + ;; for us being careful in how we execute an unreachable struct.new + (block $label$1 (result i32) + (unreachable) + ) + (rtt.canon $struct) + ) + ) ) |