xref: /llvm-project/llvm/test/CodeGen/X86/fp-stack-ret-conv.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mcpu=yonah | FileCheck %s
3
4target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
5target triple = "i686-apple-darwin8"
6
7define void @test(ptr%b) {
8; CHECK-LABEL: test:
9; CHECK:       ## %bb.0: ## %entry
10; CHECK-NEXT:    pushl %esi
11; CHECK-NEXT:    .cfi_def_cfa_offset 8
12; CHECK-NEXT:    subl $8, %esp
13; CHECK-NEXT:    .cfi_def_cfa_offset 16
14; CHECK-NEXT:    .cfi_offset %esi, -8
15; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %esi
16; CHECK-NEXT:    calll _foo
17; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
18; CHECK-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
19; CHECK-NEXT:    cvtss2sd %xmm0, %xmm0
20; CHECK-NEXT:    movsd %xmm0, (%esi)
21; CHECK-NEXT:    addl $8, %esp
22; CHECK-NEXT:    popl %esi
23; CHECK-NEXT:    retl
24entry:
25	%tmp13 = tail call double @foo()
26	%tmp1314 = fptrunc double %tmp13 to float		; <float> [#uses=1]
27	%tmp3940 = fpext float %tmp1314 to double		; <double> [#uses=1]
28	store volatile double %tmp3940, ptr %b
29	ret void
30}
31
32declare double @foo()
33