Add fast-isel support for byval calls on x86.
[oota-llvm.git] / test / CodeGen / X86 / fast-isel-call.ll
1 ; RUN: llc < %s -O0 -fast-isel-abort -march=x86 | FileCheck %s
2
3 %struct.s = type {i32, i32, i32}
4
5 define i32 @test1() nounwind {
6 tak:
7         %tmp = call i1 @foo()
8         br i1 %tmp, label %BB1, label %BB2
9 BB1:
10         ret i32 1
11 BB2:
12         ret i32 0
13 ; CHECK: test1:
14 ; CHECK: calll
15 ; CHECK-NEXT: testb     $1
16 }
17 declare i1 @foo() zeroext nounwind
18
19 declare void @foo2(%struct.s* byval)
20
21 define void @test2(%struct.s* %d) nounwind {
22   call void @foo2(%struct.s* %d byval)
23   ret void
24 ; CHECK: test2:
25 ; CHECK: movl   (%eax)
26 ; CHECK: movl {{.*}}, (%esp)
27 ; CHECK: movl   4(%eax)
28 ; CHECK: movl {{.*}}, 4(%esp)
29 ; CHECK: movl   8(%eax)
30 ; CHECK: movl {{.*}}, 8(%esp)
31 }