diff options
Diffstat (limited to 'test/lit/passes/vacuum-gc.wast')
-rw-r--r-- | test/lit/passes/vacuum-gc.wast | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lit/passes/vacuum-gc.wast b/test/lit/passes/vacuum-gc.wast index f84988f46..c7ff5a37f 100644 --- a/test/lit/passes/vacuum-gc.wast +++ b/test/lit/passes/vacuum-gc.wast @@ -2,6 +2,7 @@ ;; RUN: wasm-opt %s --vacuum -all -S -o - | filecheck %s (module + ;; CHECK: (type ${} (struct )) (type ${} (struct)) ;; CHECK: (func $drop-ref-as (type $anyref_=>_none) (param $x anyref) @@ -92,4 +93,21 @@ ) ) ) + + ;; CHECK: (func $ref.cast.null.block (type $ref|${}|_=>_dataref) (param $ref (ref ${})) (result dataref) + ;; CHECK-NEXT: (ref.cast ${} + ;; CHECK-NEXT: (local.get $ref) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $ref.cast.null.block (param $ref (ref ${})) (result (ref null data)) + ;; We can vacuum away the block, which will make this ref.cast null operate + ;; on a non-nullable input. That is, we are refining the input to the cast. + ;; The cast must be updated properly following that, to be a non-nullable + ;; cast. + (ref.cast null ${} + (block (result (ref null ${})) + (local.get $ref) + ) + ) + ) ) |