For PR950:
[oota-llvm.git] / test / Transforms / LICM / no-preheader-test.ll
1 ; Test that LICM works when there is not a loop-preheader
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis
3
4 void "testfunc"(int %i.s, bool %ifcond) {
5         br bool %ifcond, label %Then, label %Else
6 Then:
7         br label %Loop
8 Else:
9         br label %Loop
10
11 Loop:
12         %j = phi uint [0, %Then], [12, %Else], [%Next, %Loop]
13         %i = cast int %i.s to uint
14         %i2 = mul uint %i, 17
15         %Next = add uint %j, %i2
16         %cond = seteq uint %Next, 0
17         br bool %cond, label %Out, label %Loop
18
19 Out:
20         ret void
21 }