diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/coalesce-locals-gc-nn.wast | 23 | ||||
-rw-r--r-- | test/lit/passes/coalesce-locals-gc.wast | 4 |
2 files changed, 26 insertions, 1 deletions
diff --git a/test/lit/passes/coalesce-locals-gc-nn.wast b/test/lit/passes/coalesce-locals-gc-nn.wast index 21b6d2a33..69e96ac62 100644 --- a/test/lit/passes/coalesce-locals-gc-nn.wast +++ b/test/lit/passes/coalesce-locals-gc-nn.wast @@ -81,4 +81,27 @@ ) ) ) + + ;; CHECK: (func $unreachable-get-of-non-nullable + ;; CHECK-NEXT: (local $0 (ref any)) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block (result (ref any)) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $unreachable-get-of-non-nullable + ;; One local is unused entirely, the other is used but only in unreachable + ;; code. It does not really matter what we do here (coalesce, or not), but we + ;; should emit valid IR. Normally we would apply a constant to replace the + ;; local.get, however, the types here are non-nullable, so we must do + ;; something else. + (local $unused (ref any)) + (local $used-in-unreachable (ref any)) + (unreachable) + (drop + (local.get $used-in-unreachable) + ) + ) ) diff --git a/test/lit/passes/coalesce-locals-gc.wast b/test/lit/passes/coalesce-locals-gc.wast index 2c0fc3f03..52243ebc8 100644 --- a/test/lit/passes/coalesce-locals-gc.wast +++ b/test/lit/passes/coalesce-locals-gc.wast @@ -11,7 +11,9 @@ ;; CHECK: (func $test-dead-get-non-nullable (param $0 dataref) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (block (result dataref) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $test-dead-get-non-nullable (param $func (ref data)) |