42 lines · plain
1; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -relocation-model=pic -frame-pointer=all -mcpu=cortex-a8 | FileCheck %s2 3; subs r4, #14; cmp r4, 05; bgt6; cmp cannot be optimized away since it will clear the overflow bit.7; gt / ge, lt, le conditions all depend on V bit.8; rdar://91727429 10define i32 @t() nounwind {11; CHECK-LABEL: t:12entry:13 br label %bb214 15bb: ; preds = %bb216 %0 = tail call i32 @rand() nounwind17 %1 = icmp eq i32 %0, 5018 br i1 %1, label %bb3, label %bb119 20bb1: ; preds = %bb21; CHECK: bb122; CHECK: subs [[REG:r[0-9]+]], #123 %tmp = tail call i32 @puts() nounwind24 %indvar.next = add i32 %indvar, 125 br label %bb226 27bb2: ; preds = %bb1, %entry28; CHECK: cmp [[REG]], #029; CHECK: bgt30 %indvar = phi i32 [ %indvar.next, %bb1 ], [ 0, %entry ]31 %tries.0 = sub i32 2147483647, %indvar32 %tmp1 = icmp sgt i32 %tries.0, 033 br i1 %tmp1, label %bb, label %bb334 35bb3: ; preds = %bb2, %bb36 ret i32 037}38 39declare i32 @rand()40 41declare i32 @puts() nounwind42