[Codegen] Adjust saturation test. NFC.
[llvm-core.git] / test / CodeGen / X86 / fp-stack-ret.ll
blobdb54acc754c7d9d9792f9a4cd7d49fd201cff36d
1 ; RUN: llc < %s -mtriple=i686-apple-darwin8 -mcpu=yonah | FileCheck %s
3 ; These testcases shouldn't require loading into an XMM register then storing 
4 ; to memory, then reloading into an FPStack reg.
6 ; CHECK: test1
7 ; CHECK: fldl
8 ; CHECK-NEXT: ret
9 define double @test1(double *%P) {
10         %A = load double, double* %P
11         ret double %A
14 ; fastcc should return a value
15 ; CHECK: test2
16 ; CHECK-NOT: xmm
17 ; CHECK: ret
18 define fastcc double @test2(<2 x double> %A) {
19         %B = extractelement <2 x double> %A, i32 0
20         ret double %B
23 ; CHECK: test3
24 ; CHECK: sub{{.*}}%esp
25 ; CHECK-NOT: xmm
26 define 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
32 ; Clear the stack when not using a return value.
33 ; CHECK: test4
34 ; CHECK: call
35 ; CHECK: fstp
36 ; CHECK: ret
37 define void @test4(double *%P) {
38   %A = call double @test1(double *%P)
39   ret void