diff options
author | Alon Zakai <azakai@google.com> | 2021-03-24 10:54:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 10:54:49 -0700 |
commit | 0b0e20f9802afa2f74a896853b4c1be4d3f49f1e (patch) | |
tree | beb1a0f831f328967b973ee6e383c9ba743418a2 /test | |
parent | 7d00f654bb3545beb5772f2f19768a48779e3db6 (diff) | |
download | binaryen-0b0e20f9802afa2f74a896853b4c1be4d3f49f1e.tar.gz binaryen-0b0e20f9802afa2f74a896853b4c1be4d3f49f1e.tar.bz2 binaryen-0b0e20f9802afa2f74a896853b4c1be4d3f49f1e.zip |
[Wasm GC] Handle non-nullable locals in Flatten pass (#3720)
That pass adds lots of new locals, and we need to handle non-nullable ones.
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/flatten_all-features.txt | 17 | ||||
-rw-r--r-- | test/passes/flatten_all-features.wast | 10 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/passes/flatten_all-features.txt b/test/passes/flatten_all-features.txt index efcce6797..99c8cb4bb 100644 --- a/test/passes/flatten_all-features.txt +++ b/test/passes/flatten_all-features.txt @@ -2443,3 +2443,20 @@ (unreachable) ) ) +(module + (type $none_=>_none (func)) + (type $none_=>_funcref (func (result funcref))) + (func $0 (result funcref) + (local $0 (ref null $none_=>_none)) + (local.set $0 + (ref.as_non_null + (ref.null $none_=>_none) + ) + ) + (return + (ref.as_non_null + (local.get $0) + ) + ) + ) +) diff --git a/test/passes/flatten_all-features.wast b/test/passes/flatten_all-features.wast index 14da24a74..874e91572 100644 --- a/test/passes/flatten_all-features.wast +++ b/test/passes/flatten_all-features.wast @@ -1055,3 +1055,13 @@ ) ) ) +;; non-nullable temp vars we add must be handled properly, as non-nullable +;; locals are not allowed +(module + (type $none_=>_none (func)) + (func $0 (result funcref) + (ref.as_non_null + (ref.null $none_=>_none) + ) + ) +) |