new testcase for PR582
[oota-llvm.git] / test / Transforms / IndVarsSimplify / 2005-06-15-InstMoveCrash.ll
1 ; RUN: llvm-as < %s | opt -indvars -disable-output
2
3 void %main() {
4 entry:
5         br label %no_exit.1.outer
6
7 no_exit.1.outer:                ; preds = %endif.0, %entry
8         %l_14237116.1.0.ph = phi sbyte [ -46, %entry ], [ 0, %endif.0 ]         ; <sbyte> [#uses=1]
9         %i.0.0.0.ph = phi int [ 0, %entry ], [ %inc.1, %endif.0 ]               ; <int> [#uses=1]
10         br label %no_exit.1
11
12 no_exit.1:              ; preds = %_Z13func_47880058cc.exit, %no_exit.1.outer
13         br bool false, label %_Z13func_47880058cc.exit, label %then.i
14
15 then.i:         ; preds = %no_exit.1
16         br label %_Z13func_47880058cc.exit
17
18 _Z13func_47880058cc.exit:               ; preds = %then.i, %no_exit.1
19         br bool false, label %then.0, label %no_exit.1
20
21 then.0:         ; preds = %_Z13func_47880058cc.exit
22         %tmp.6 = cast sbyte %l_14237116.1.0.ph to ubyte         ; <ubyte> [#uses=1]
23         br bool false, label %endif.0, label %then.1
24
25 then.1:         ; preds = %then.0
26         br label %endif.0
27
28 endif.0:                ; preds = %then.1, %then.0
29         %inc.1 = add int %i.0.0.0.ph, 1         ; <int> [#uses=2]
30         %tmp.2 = setgt int %inc.1, 99           ; <bool> [#uses=1]
31         br bool %tmp.2, label %loopexit.0, label %no_exit.1.outer
32
33 loopexit.0:             ; preds = %endif.0
34         %tmp.28 = cast ubyte %tmp.6 to uint             ; <uint> [#uses=0]
35         ret void
36 }