c5f52aa44089377ffd437cc8e9cbaeabd4c24ea9
[oota-llvm.git] / test / Transforms / CorrelatedExprs / 2002-10-07-DominatorProblem.ll
1 ; RUN: as < %s | opt -cee
2 ;
3 ; The 'cee' pass is breaking SSA form when it blindly forwards the branch from 
4 ; Eq to branch to "Forwarded" instead.
5
6 implementation
7
8 int %test(int %A, int %B, bool %c0) {
9 Start:
10         %c1 = seteq int %A, %B
11         br bool %c1, label %Eq, label %Loop
12
13 Eq:     ; In this block we know that A == B
14         br label %Loop    ; This should be modified to branch to "Forwarded".
15
16 Loop:        ;; Merge point, nothing is known here...
17         %Z = phi int [%A, %Start], [%B, %Eq], [%Z, %Bottom]
18         %c2 = setgt int %A, %B
19         br bool %c2, label %Forwarded, label %Bottom
20
21 Forwarded:
22         call int %test(int 0, int %Z, bool true)
23         br label %Bottom
24
25 Bottom:
26         br label %Loop
27 }