| Chris Lattner | 4ded20b | 2003-06-24 20:29:36 +0000 | [diff] [blame^] | 1 | ; RUN: if as < %s | opt -sccp -simplifycfg | dis | grep then: |
| 2 | ; RUN: then exit 1 |
| 3 | ; RUN: else exit 0 |
| 4 | ; RUN: fi |
| 5 | |
| 6 | void %cprop_test11(int* %data.1) { |
| 7 | entry: ; No predecessors! |
| 8 | %tmp.1 = load int* %data.1 ; <int> [#uses=3] |
| 9 | %tmp.41 = setgt int %tmp.1, 1 ; <bool> [#uses=1] |
| 10 | br bool %tmp.41, label %no_exit, label %loopexit |
| 11 | |
| 12 | no_exit: ; preds = %entry, %then, %endif |
| 13 | %j.0 = phi int [ %j.0, %endif ], [ %i.0, %then ], [ 1, %entry ] ; <int> [#uses=3] |
| 14 | %i.0 = phi int [ %inc, %endif ], [ %inc1, %then ], [ 1, %entry ] ; <int> [#uses=4] |
| 15 | %tmp.8.not = cast int %j.0 to bool ; <bool> [#uses=1] |
| 16 | br bool %tmp.8.not, label %endif, label %then |
| 17 | |
| 18 | then: ; preds = %no_exit |
| 19 | %inc1 = add int %i.0, 1 ; <int> [#uses=3] |
| 20 | %tmp.42 = setlt int %inc1, %tmp.1 ; <bool> [#uses=1] |
| 21 | br bool %tmp.42, label %no_exit, label %loopexit |
| 22 | |
| 23 | endif: ; preds = %no_exit |
| 24 | %inc = add int %i.0, 1 ; <int> [#uses=3] |
| 25 | %tmp.4 = setlt int %inc, %tmp.1 ; <bool> [#uses=1] |
| 26 | br bool %tmp.4, label %no_exit, label %loopexit |
| 27 | |
| 28 | loopexit: ; preds = %entry, %endif, %then |
| 29 | %j.1 = phi int [ 1, %entry ], [ %j.0, %endif ], [ %i.0, %then ] ; <int> [#uses=1] |
| 30 | %i.1 = phi int [ 1, %entry ], [ %inc, %endif ], [ %inc1, %then ] ; <int> [#uses=1] |
| 31 | %tmp.17 = getelementptr int* %data.1, long 1 ; <int*> [#uses=1] |
| 32 | store int %j.1, int* %tmp.17 |
| 33 | %tmp.23 = getelementptr int* %data.1, long 2 ; <int*> [#uses=1] |
| 34 | store int %i.1, int* %tmp.23 |
| 35 | ret void |
| 36 | } |