diff options
author | Alon Zakai <azakai@google.com> | 2023-03-03 14:36:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-03 14:36:34 -0800 |
commit | 069aec9946473f946e96dc82ca0ce40a8024c50f (patch) | |
tree | a1febaa4dfce870bfd39ee53820457143e9ab614 /test | |
parent | c891c01ca5813172775ae859126a0ec3857ad8b7 (diff) | |
download | binaryen-069aec9946473f946e96dc82ca0ce40a8024c50f.tar.gz binaryen-069aec9946473f946e96dc82ca0ce40a8024c50f.tar.bz2 binaryen-069aec9946473f946e96dc82ca0ce40a8024c50f.zip |
[Wasm GC] Skip types with subtypes in SignatureRefining (#5544)
For now just skip them, to avoid problems. In the future we should look
into modifying their children, when possible.
Fixes #5463
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/signature-refining.wast | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/lit/passes/signature-refining.wast b/test/lit/passes/signature-refining.wast index d814e8194..353d3d211 100644 --- a/test/lit/passes/signature-refining.wast +++ b/test/lit/passes/signature-refining.wast @@ -758,3 +758,25 @@ ) ) ) + +;; If we refine a type, that may require changes to its subtypes. For now, we +;; skip such optimizations. TODO +(module + (rec + ;; CHECK: (type $A (func (param (ref null $B)) (result (ref null $A)))) + (type $A (func (param (ref null $B)) (result (ref null $A)))) + ;; CHECK: (type $B (func_subtype (param (ref null $A)) (result (ref null $B)) $A)) + (type $B (func_subtype (param (ref null $A)) (result (ref null $B)) $A)) + ) + + ;; CHECK: (elem declare func $func) + + ;; CHECK: (func $func (type $A) (param $0 (ref null $B)) (result (ref null $A)) + ;; CHECK-NEXT: (ref.func $func) + ;; CHECK-NEXT: ) + (func $func (type $A) (param $0 (ref null $B)) (result (ref null $A)) + ;; This result is non-nullable, and we could refine type $A accordingly. But + ;; if we did that, we'd need to refine $B as well. + (ref.func $func) + ) +) |