Fix a minor regression from my dag combiner changes. One more place which needs to...
[oota-llvm.git] / test / CodeGen / X86 / phys-reg-local-regalloc.ll
1 ; RUN: llc < %s -march=x86 -mtriple=i386-apple-darwin9 -regalloc=local | FileCheck %s
2
3 @.str = private constant [12 x i8] c"x + y = %i\0A\00", align 1 ; <[12 x i8]*> [#uses=1]
4
5 define i32 @main() nounwind {
6 entry:
7 ; CHECK: movl 24(%esp), %eax
8 ; CHECK-NOT: movl
9 ; CHECK: movl   %eax, 36(%esp)
10 ; CHECK-NOT: movl
11 ; CHECK: movl 28(%esp), %ebx
12 ; CHECK-NOT: movl
13 ; CHECK: movl   %ebx, 40(%esp)
14 ; CHECK-NOT: movl
15 ; CHECK: addl %ebx, %eax
16   %retval = alloca i32                            ; <i32*> [#uses=2]
17   %"%ebx" = alloca i32                            ; <i32*> [#uses=1]
18   %"%eax" = alloca i32                            ; <i32*> [#uses=2]
19   %result = alloca i32                            ; <i32*> [#uses=2]
20   %y = alloca i32                                 ; <i32*> [#uses=2]
21   %x = alloca i32                                 ; <i32*> [#uses=2]
22   %0 = alloca i32                                 ; <i32*> [#uses=2]
23   %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
24   store i32 1, i32* %x, align 4
25   store i32 2, i32* %y, align 4
26   call void asm sideeffect alignstack "# top of block", "~{dirflag},~{fpsr},~{flags},~{edi},~{esi},~{edx},~{ecx},~{eax}"() nounwind
27   %asmtmp = call i32 asm sideeffect alignstack "movl $1, $0", "=={eax},*m,~{dirflag},~{fpsr},~{flags},~{memory}"(i32* %x) nounwind ; <i32> [#uses=1]
28   store i32 %asmtmp, i32* %"%eax"
29   %asmtmp1 = call i32 asm sideeffect alignstack "movl $1, $0", "=={ebx},*m,~{dirflag},~{fpsr},~{flags},~{memory}"(i32* %y) nounwind ; <i32> [#uses=1]
30   store i32 %asmtmp1, i32* %"%ebx"
31   %1 = call i32 asm "", "={bx}"() nounwind        ; <i32> [#uses=1]
32   %2 = call i32 asm "", "={ax}"() nounwind        ; <i32> [#uses=1]
33   %asmtmp2 = call i32 asm sideeffect alignstack "addl $1, $0", "=={eax},{ebx},{eax},~{dirflag},~{fpsr},~{flags},~{memory}"(i32 %1, i32 %2) nounwind ; <i32> [#uses=1]
34   store i32 %asmtmp2, i32* %"%eax"
35   %3 = call i32 asm "", "={ax}"() nounwind        ; <i32> [#uses=1]
36   call void asm sideeffect alignstack "movl $0, $1", "{eax},*m,~{dirflag},~{fpsr},~{flags},~{memory}"(i32 %3, i32* %result) nounwind
37   %4 = load i32* %result, align 4                 ; <i32> [#uses=1]
38   %5 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 %4) nounwind ; <i32> [#uses=0]
39   store i32 0, i32* %0, align 4
40   %6 = load i32* %0, align 4                      ; <i32> [#uses=1]
41   store i32 %6, i32* %retval, align 4
42   br label %return
43
44 return:                                           ; preds = %entry
45   %retval3 = load i32* %retval                    ; <i32> [#uses=1]
46   ret i32 %retval3
47 }
48
49 declare i32 @printf(i8*, ...) nounwind