Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / SimplifyCFG / 2006-10-19-UncondDiv.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg -disable-output &&
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | not grep select
3
4 ; PR957
5
6 uint %test(uint %tmp) {
7 cond_false179:          ; preds = %cond_true
8         %tmp181 = seteq uint %tmp, 0            ; <bool> [#uses=1]
9         br bool %tmp181, label %cond_true182, label %cond_next185
10
11 cond_true182:           ; preds = %cond_false179
12         br label %cond_next185
13
14 cond_next185:           ; preds = %cond_true182, %cond_false179
15         %d0.3 = phi uint [ div (uint 1, uint 0), %cond_true182 ], [ %tmp,
16 %cond_false179 ]                ; <uint> [#uses=7]
17
18         ret uint %d0.3
19 }
20
21 uint %test2(uint %tmp) {
22 cond_false179:          ; preds = %cond_true
23         %tmp181 = seteq uint %tmp, 0            ; <bool> [#uses=1]
24         br bool %tmp181, label %cond_true182, label %cond_next185
25
26 cond_true182:           ; preds = %cond_false179
27         br label %cond_next185
28
29 cond_next185:           ; preds = %cond_true182, %cond_false179
30         %d0.3 = phi uint [ div (uint 1, uint 0), %cond_true182 ], [ %tmp,
31 %cond_false179 ]                ; <uint> [#uses=7]
32         call uint %test(uint 4)
33         ret uint %d0.3
34 }
35