fix a globalopt crash on two Adobe-C++ testcases that the recent
[llvm.git] / test / Transforms / LoopSimplify / indirectbr-backedge.ll
blobca6e47fcecd3c3c1feddb785b571cf2e2783261e
1 ; RUN: opt -loopsimplify -S < %s | FileCheck %s
3 ; LoopSimplify shouldn't split loop backedges that use indirectbr.
5 ; CHECK: bb1:                                              ; preds = %bb5, %bb
6 ; CHECK-NEXT: indirectbr
8 ; CHECK: bb5:                                              ; preds = %bb1
9 ; CHECK-NEXT: br label %bb1{{$}}
11 define void @foo(i8* %p) nounwind {
12 bb:
13   br label %bb1
15 bb1:                                              ; preds = %bb5, %bb1, %bb
16   indirectbr i8* %p, [label %bb6, label %bb7, label %bb1, label %bb2, label %bb3, label %bb5, label %bb4]
18 bb2:                                              ; preds = %bb1
19   ret void
21 bb3:                                              ; preds = %bb1
22   ret void
24 bb4:                                              ; preds = %bb1
25   ret void
27 bb5:                                              ; preds = %bb1
28   br label %bb1
30 bb6:                                              ; preds = %bb1
31   ret void
33 bb7:                                              ; preds = %bb1
34   ret void