1 ; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -simplifycfg | llvm-dis | not grep then:
3 void %cprop_test11(int* %data.1) {
4 entry: ; No predecessors!
5 %tmp.1 = load int* %data.1 ; <int> [#uses=3]
6 %tmp.41 = setgt int %tmp.1, 1 ; <bool> [#uses=1]
7 br bool %tmp.41, label %no_exit, label %loopexit
9 no_exit: ; preds = %entry, %then, %endif
10 %j.0 = phi int [ %j.0, %endif ], [ %i.0, %then ], [ 1, %entry ] ; <int> [#uses=3]
11 %i.0 = phi int [ %inc, %endif ], [ %inc1, %then ], [ 1, %entry ] ; <int> [#uses=4]
12 %tmp.8.not = cast int %j.0 to bool ; <bool> [#uses=1]
13 br bool %tmp.8.not, label %endif, label %then
15 then: ; preds = %no_exit
16 %inc1 = add int %i.0, 1 ; <int> [#uses=3]
17 %tmp.42 = setlt int %inc1, %tmp.1 ; <bool> [#uses=1]
18 br bool %tmp.42, label %no_exit, label %loopexit
20 endif: ; preds = %no_exit
21 %inc = add int %i.0, 1 ; <int> [#uses=3]
22 %tmp.4 = setlt int %inc, %tmp.1 ; <bool> [#uses=1]
23 br bool %tmp.4, label %no_exit, label %loopexit
25 loopexit: ; preds = %entry, %endif, %then
26 %j.1 = phi int [ 1, %entry ], [ %j.0, %endif ], [ %i.0, %then ] ; <int> [#uses=1]
27 %i.1 = phi int [ 1, %entry ], [ %inc, %endif ], [ %inc1, %then ] ; <int> [#uses=1]
28 %tmp.17 = getelementptr int* %data.1, long 1 ; <int*> [#uses=1]
29 store int %j.1, int* %tmp.17
30 %tmp.23 = getelementptr int* %data.1, long 2 ; <int*> [#uses=1]
31 store int %i.1, int* %tmp.23