[InstCombine] Signed saturation tests. NFC
[llvm-complete.git] / test / Transforms / LowerSwitch / phi-in-dead-block.ll
bloba632584f7eb96ecba13ac61345987a503de3bc84
1 ; RUN: opt -S -lowerswitch %s | FileCheck %s
3 ; CHECK-LABEL: @phi_in_dead_block(
4 ; CHECK-NOT: switch
5 define void @phi_in_dead_block() {
6 bb:
7   br i1 undef, label %bb2, label %bb3
9 bb1:                                              ; No predecessors!
10   switch i32 undef, label %bb2 [
11     i32 9, label %bb3
12   ]
14 bb2:                                              ; preds = %bb1, %bb
15   %tmp = phi i64 [ undef, %bb1 ], [ undef, %bb ]
16   unreachable
18 bb3:                                              ; preds = %bb1, %bb
19   unreachable
22 ; CHECK-LABEL: @phi_in_dead_block_br_to_self(
23 ; CHECK-NOT: switch
24 define void @phi_in_dead_block_br_to_self() {
25 bb:
26   br i1 undef, label %bb2, label %bb3
28 bb1:                                              ; No predecessors!
29   switch i32 undef, label %bb2 [
30     i32 9, label %bb3
31     i32 10, label %bb1
32   ]
34 bb2:                                              ; preds = %bb1, %bb
35   %tmp = phi i64 [ undef, %bb1 ], [ undef, %bb ]
36   unreachable
38 bb3:                                              ; preds = %bb1, %bb
39   unreachable