diff options
Diffstat (limited to 'test/lit/passes')
-rw-r--r-- | test/lit/passes/heap2local.wast | 25 | ||||
-rw-r--r-- | test/lit/passes/precompute-gc.wast | 20 |
2 files changed, 44 insertions, 1 deletions
diff --git a/test/lit/passes/heap2local.wast b/test/lit/passes/heap2local.wast index d49836b99..90ac8a418 100644 --- a/test/lit/passes/heap2local.wast +++ b/test/lit/passes/heap2local.wast @@ -254,7 +254,7 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit) ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (struct.new_with_rtt $struct.A + ;; CHECK-NEXT: (block ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (rtt.canon $struct.A) @@ -1937,4 +1937,27 @@ ) ) ) + + ;; CHECK: (func $simple-no-rtt + ;; CHECK-NEXT: (local $0 i32) + ;; CHECK-NEXT: (local $1 f64) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block (result (ref null $struct.A)) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (ref.null $struct.A) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $simple-no-rtt + (drop + ;; This allocation has no rtt, so we have nothing to drop from it when + ;; we optimize. + (struct.new_default $struct.A) + ) + ) ) diff --git a/test/lit/passes/precompute-gc.wast b/test/lit/passes/precompute-gc.wast index 0a08c02c0..44eff1c5f 100644 --- a/test/lit/passes/precompute-gc.wast +++ b/test/lit/passes/precompute-gc.wast @@ -510,4 +510,24 @@ ) ) ) + + ;; CHECK: (func $new_block_unreachable (result anyref) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (rtt.canon $struct) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $new_block_unreachable (result anyref) + (struct.new_with_rtt $struct + ;; The value is a block with an unreachable. precompute will get rid of the + ;; block, after which fuzz-exec should not crash - this is a regression test + ;; for us being careful in how we execute an unreachable struct.new + (block $label$1 (result i32) + (unreachable) + ) + (rtt.canon $struct) + ) + ) ) |