Index: test/CodeGen/X86/fast-isel-x86-64.ll |
=================================================================== |
--- test/CodeGen/X86/fast-isel-x86-64.ll (revision 137987) |
+++ test/CodeGen/X86/fast-isel-x86-64.ll (working copy) |
@@ -259,4 +259,27 @@ |
; CHECK: test21: |
; CHECK-NOT: pxor |
; CHECK: movsd LCPI |
-} |
+} |
+ |
+; Check that immediate arguments to a function |
+; do not cause massive spilling and are used |
+; as immediates just before the call. |
+define void @test22() nounwind { |
+entry: |
+ call void @foo22(i32 0) |
+ call void @foo22(i32 1) |
+ call void @foo22(i32 2) |
+ call void @foo22(i32 3) |
+ ret void |
+; CHECK: test22: |
+; CHECK: movl $0, %edi |
+; CHECK: callq _foo22 |
+; CHECK: movl $1, %edi |
+; CHECK: callq _foo22 |
+; CHECK: movl $2, %edi |
+; CHECK: callq _foo22 |
+; CHECK: movl $3, %edi |
+; CHECK: callq _foo22 |
+} |
+ |
+declare void @foo22(i32) |