summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-08-02 11:38:50 -0700
committerGitHub <noreply@github.com>2021-08-02 11:38:50 -0700
commitcde2830e44a3248d0f2d9750f180635c0465a579 (patch)
treeb827176989ec5002612518328aab77a4b9762b4a /test
parent7835f7d4d4d2d0118ba40b9f60fb32de8a43c272 (diff)
downloadbinaryen-cde2830e44a3248d0f2d9750f180635c0465a579.tar.gz
binaryen-cde2830e44a3248d0f2d9750f180635c0465a579.tar.bz2
binaryen-cde2830e44a3248d0f2d9750f180635c0465a579.zip
[Wasm GC] Handle unreachability in LocalSubtyping (#4044)
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/local-subtyping.wast35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/lit/passes/local-subtyping.wast b/test/lit/passes/local-subtyping.wast
index 27f0fe1d0..c24126e1a 100644
--- a/test/lit/passes/local-subtyping.wast
+++ b/test/lit/passes/local-subtyping.wast
@@ -249,4 +249,39 @@
(local.get $x)
)
)
+
+ ;; CHECK: (func $unreachables (result funcref)
+ ;; CHECK-NEXT: (local $temp (ref null $none_=>_funcref))
+ ;; CHECK-NEXT: (local.set $temp
+ ;; CHECK-NEXT: (ref.func $unreachables)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (unreachable)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (block $block (result (ref null $none_=>_funcref))
+ ;; CHECK-NEXT: (local.tee $temp
+ ;; CHECK-NEXT: (ref.func $unreachables)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.get $temp)
+ ;; CHECK-NEXT: )
+ (func $unreachables (result funcref)
+ (local $temp funcref)
+ ;; Set a value that allows us to refine the local's type.
+ (local.set $temp
+ (ref.func $unreachables)
+ )
+ (unreachable)
+ ;; A tee that is not reachable. We must still update its type, and the
+ ;; parents.
+ (drop
+ (block (result funcref)
+ (local.tee $temp
+ (ref.func $unreachables)
+ )
+ )
+ )
+ ;; A get that is not reachable. We must still update its type.
+ (local.get $temp)
+ )
)