1 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -relocation-model=pic -disable-fp-elim -mcpu=cortex-a8 | FileCheck %s
6 ; cmp cannot be optimized away since it will clear the overflow bit.
7 ; gt / ge, lt, le conditions all depend on V bit.
10 define i32 @t() nounwind {
16 %0 = tail call i32 @rand() nounwind
17 %1 = icmp eq i32 %0, 50
18 br i1 %1, label %bb3, label %bb1
21 %tmp = tail call i32 @puts() nounwind
22 %indvar.next = add i32 %indvar, 1
25 bb2: ; preds = %bb1, %entry
27 ; CHECK: subs [[REG:r[0-9]+]], #1
28 ; CHECK: cmp [[REG]], #0
30 %indvar = phi i32 [ %indvar.next, %bb1 ], [ 0, %entry ]
31 %tries.0 = sub i32 2147483647, %indvar
32 %tmp1 = icmp sgt i32 %tries.0, 0
33 br i1 %tmp1, label %bb, label %bb3
35 bb3: ; preds = %bb2, %bb
41 declare i32 @puts() nounwind