1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-- < %s | FileCheck %s
4 @.str = internal constant [4 x i8] c"%d\0A\00"
6 declare i32 @printf(ptr noalias , ...) nounwind
8 define i32 @main() nounwind {
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: pushq %rbx
12 ; CHECK-NEXT: movl $10271, %ebx # imm = 0x281F
13 ; CHECK-NEXT: .p2align 4, 0x90
14 ; CHECK-NEXT: .LBB0_1: # %forbody
15 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
16 ; CHECK-NEXT: movl $.str, %edi
17 ; CHECK-NEXT: movl %ebx, %esi
18 ; CHECK-NEXT: xorl %eax, %eax
19 ; CHECK-NEXT: callq printf@PLT
20 ; CHECK-NEXT: addl $-10, %ebx
21 ; CHECK-NEXT: cmpl $1, %ebx
22 ; CHECK-NEXT: jne .LBB0_1
23 ; CHECK-NEXT: # %bb.2: # %afterfor
24 ; CHECK-NEXT: xorl %eax, %eax
25 ; CHECK-NEXT: popq %rbx
31 %i.0 = phi i32 [ 0, %entry ], [ %inc, %forbody ] ; <i32>[#uses=3]
32 %sub14 = sub i32 1027, %i.0 ; <i32> [#uses=1]
33 %mul15 = mul i32 %sub14, 10 ; <i32> [#uses=1]
34 %add166 = or disjoint i32 %mul15, 1 ; <i32> ptr
35 call i32 (ptr, ...) @printf( ptr noalias @.str, i32 %add166 ) nounwind
36 %inc = add i32 %i.0, 1 ; <i32> [#uses=3]
37 %cmp = icmp ne i32 %inc, 1027 ; <i1> [#uses=1]
38 br i1 %cmp, label %forbody, label %afterfor
40 afterfor: ; preds = %forcond