InstSimplify: Simplify trivial and/or of icmps
[oota-llvm.git] / test / Transforms / LoopSimplify / indirectbr-backedge.ll
1 ; RUN: opt -loop-simplify -S < %s | FileCheck %s
2
3 ; LoopSimplify shouldn't split loop backedges that use indirectbr.
4
5 ; CHECK: bb1:                                              ; preds = %bb5, %bb
6 ; CHECK-NEXT: indirectbr
7
8 ; CHECK: bb5:                                              ; preds = %bb1
9 ; CHECK-NEXT: br label %bb1{{$}}
10
11 define void @foo(i8* %p) nounwind {
12 bb:
13   br label %bb1
14
15 bb1:                                              ; preds = %bb5, %bb1, %bb
16   indirectbr i8* %p, [label %bb6, label %bb7, label %bb1, label %bb2, label %bb3, label %bb5, label %bb4]
17
18 bb2:                                              ; preds = %bb1
19   ret void
20
21 bb3:                                              ; preds = %bb1
22   ret void
23
24 bb4:                                              ; preds = %bb1
25   ret void
26
27 bb5:                                              ; preds = %bb1
28   br label %bb1
29
30 bb6:                                              ; preds = %bb1
31   ret void
32
33 bb7:                                              ; preds = %bb1
34   ret void
35 }