1; RUN: llc < %s -mtriple=i686-apple-darwin8 -mcpu=yonah -march=x86 | FileCheck %s
2
3; These testcases shouldn't require loading into an XMM register then storing
4; to memory, then reloading into an FPStack reg.
5
6; CHECK: test1
7; CHECK: fldl
8; CHECK-NEXT: ret
9define double @test1(double *%P) {
10        %A = load double* %P
11        ret double %A
12}
13
14; fastcc should return a value
15; CHECK: test2
16; CHECK-NOT: xmm
17; CHECK: ret
18define fastcc double @test2(<2 x double> %A) {
19	%B = extractelement <2 x double> %A, i32 0
20	ret double %B
21}
22
23; CHECK: test3
24; CHECK: sub{{.*}}%esp
25; CHECK-NOT: xmm
26define fastcc double @test3(<4 x float> %A) {
27	%B = bitcast <4 x float> %A to <2 x double>
28	%C = call fastcc double @test2(<2 x double> %B)
29	ret double %C
30}
31
32; Clear the stack when not using a return value.
33; CHECK: test4
34; CHECK: call
35; CHECK: fstp
36; CHECK: ret
37define void @test4(double *%P) {
38  %A = call double @test1(double *%P)
39  ret void
40}
41