summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/fast-isel-call.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/fast-isel-call.ll')
-rw-r--r--test/CodeGen/X86/fast-isel-call.ll44
1 files changed, 37 insertions, 7 deletions
diff --git a/test/CodeGen/X86/fast-isel-call.ll b/test/CodeGen/X86/fast-isel-call.ll
index 9fd07b521ab2..ee70404bcedf 100644
--- a/test/CodeGen/X86/fast-isel-call.ll
+++ b/test/CodeGen/X86/fast-isel-call.ll
@@ -1,4 +1,5 @@
-; RUN: llc < %s -O0 -fast-isel-abort=1 -march=x86 | FileCheck %s
+; RUN: llc < %s -O0 -fast-isel-abort=1 -march=x86 -mtriple=i686-apple-darwin8 2>/dev/null | FileCheck %s
+; RUN: llc < %s -O0 -fast-isel-abort=1 -march=x86 -mtriple=i686-apple-darwin8 2>&1 >/dev/null | FileCheck -check-prefix=STDERR -allow-empty %s
%struct.s = type {i32, i32, i32}
@@ -22,12 +23,12 @@ define void @test2(%struct.s* %d) nounwind {
call void @foo2(%struct.s* byval %d )
ret void
; CHECK-LABEL: test2:
-; CHECK: movl (%eax)
-; CHECK: movl {{.*}}, (%esp)
-; CHECK: movl 4(%eax)
-; CHECK: movl {{.*}}, 4(%esp)
-; CHECK: movl 8(%eax)
-; CHECK: movl {{.*}}, 8(%esp)
+; CHECK: movl (%eax), %ecx
+; CHECK: movl %ecx, (%esp)
+; CHECK: movl 4(%eax), %ecx
+; CHECK: movl %ecx, 4(%esp)
+; CHECK: movl 8(%eax), %eax
+; CHECK: movl %eax, 8(%esp)
}
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
@@ -53,3 +54,32 @@ define void @test4(i8* %a, i8* %b) {
; CHECK: movl $100, 8(%esp)
; CHECK: calll {{.*}}memcpy
}
+
+; STDERR-NOT: FastISel missed call: call x86_thiscallcc void @thiscallfun
+%struct.S = type { i8 }
+define void @test5() {
+entry:
+ %s = alloca %struct.S, align 1
+; CHECK-LABEL: test5:
+; CHECK: subl $12, %esp
+; CHECK: leal 8(%esp), %ecx
+; CHECK: movl $43, (%esp)
+; CHECK: calll {{.*}}thiscallfun
+; CHECK: addl $8, %esp
+ call x86_thiscallcc void @thiscallfun(%struct.S* %s, i32 43)
+ ret void
+}
+declare x86_thiscallcc void @thiscallfun(%struct.S*, i32) #1
+
+; STDERR-NOT: FastISel missed call: call x86_stdcallcc void @stdcallfun
+define void @test6() {
+entry:
+; CHECK-LABEL: test6:
+; CHECK: subl $12, %esp
+; CHECK: movl $43, (%esp)
+; CHECK: calll {{.*}}stdcallfun
+; CHECK: addl $8, %esp
+ call x86_stdcallcc void @stdcallfun(i32 43)
+ ret void
+}
+declare x86_stdcallcc void @stdcallfun(i32) #1