diff options
author | Alon Zakai <azakai@google.com> | 2021-07-23 17:16:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-23 17:16:34 -0700 |
commit | ae060f070064fd87adae7ea9db5aeb2dace5a4ff (patch) | |
tree | 5dbee229ecef3af430d87bf3931034a84d379c12 /test/lit/passes/local-subtyping.wast | |
parent | 0b0054342af5c73de62ddf0603619292443c505c (diff) | |
download | binaryen-ae060f070064fd87adae7ea9db5aeb2dace5a4ff.tar.gz binaryen-ae060f070064fd87adae7ea9db5aeb2dace5a4ff.tar.bz2 binaryen-ae060f070064fd87adae7ea9db5aeb2dace5a4ff.zip |
[Wasm GC] Handle nondefaultable types in LocalSubtyping (#4019)
The pass handled non-nullability, but another case is a tuple with nullable
values in it that is assigned non-nullable values, and in general, other stuff
that is nondefaultable (but not non-nullable). Ignore those.
Diffstat (limited to 'test/lit/passes/local-subtyping.wast')
-rw-r--r-- | test/lit/passes/local-subtyping.wast | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/lit/passes/local-subtyping.wast b/test/lit/passes/local-subtyping.wast index 59f93ce43..2f5c4dc4f 100644 --- a/test/lit/passes/local-subtyping.wast +++ b/test/lit/passes/local-subtyping.wast @@ -202,4 +202,25 @@ ) ) ) + + ;; CHECK: (func $nondefaultable + ;; CHECK-NEXT: (local $x (anyref anyref)) + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (tuple.make + ;; CHECK-NEXT: (ref.func $i32) + ;; CHECK-NEXT: (ref.func $i32) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $nondefaultable + (local $x (anyref anyref)) + ;; This tuple is assigned non-nullable values, which means the subtype is + ;; nondefaultable, and we must not apply it. + (local.set $x + (tuple.make + (ref.func $i32) + (ref.func $i32) + ) + ) + ) ) |