diff options
author | Alon Zakai <azakai@google.com> | 2021-03-24 08:02:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 08:02:59 -0700 |
commit | 182a1fbc41becdfdfbfcf02a2d67798fb087e7c1 (patch) | |
tree | edf27b5cea41fb67fa23b2510ffe62c9d6104174 /test | |
parent | 6aa04fa17a5bf820c8bc3a7801ede7f57a9138e7 (diff) | |
download | binaryen-182a1fbc41becdfdfbfcf02a2d67798fb087e7c1.tar.gz binaryen-182a1fbc41becdfdfbfcf02a2d67798fb087e7c1.tar.bz2 binaryen-182a1fbc41becdfdfbfcf02a2d67798fb087e7c1.zip |
[Wasm GC] Fix canMakeZero on tuples (#3721)
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/vacuum_all-features.txt | 7 | ||||
-rw-r--r-- | test/passes/vacuum_all-features.wast | 28 |
2 files changed, 35 insertions, 0 deletions
diff --git a/test/passes/vacuum_all-features.txt b/test/passes/vacuum_all-features.txt index c7c22572a..7de8ffa42 100644 --- a/test/passes/vacuum_all-features.txt +++ b/test/passes/vacuum_all-features.txt @@ -494,3 +494,10 @@ (nop) ) ) +(module + (type $none_=>_none (func)) + (global $global$0 (mut i32) (i32.const 10)) + (func $1 + (nop) + ) +) diff --git a/test/passes/vacuum_all-features.wast b/test/passes/vacuum_all-features.wast index 46678bd8e..c074fe234 100644 --- a/test/passes/vacuum_all-features.wast +++ b/test/passes/vacuum_all-features.wast @@ -885,3 +885,31 @@ ) ) ) +(module + (global $global$0 (mut i32) (i32.const 10)) + (func $1 + (drop + (block $block (result funcref i32) + ;; we can vaccum out all parts of this block: the br_if is not taken, there + ;; is a nop, and the tuple at the end goes to a dropped block anyhow. this + ;; test specifically verifies handling of tuples containing non-nullable + ;; types, for which we try to create a zero in an intermediate step along + ;; the way. + (drop + (br_if $block + (tuple.make + (ref.func $1) + (i32.const 0) + ) + (i32.const 0) + ) + ) + (nop) + (tuple.make + (ref.func $1) + (i32.const 1) + ) + ) + ) + ) +) |