]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/X86/sibcall-5.ll
Vendor import of llvm trunk r154661:
[FreeBSD/FreeBSD.git] / test / CodeGen / X86 / sibcall-5.ll
1 ; RUN: llc < %s -mtriple=i386-apple-darwin8 -mattr=+sse2  | FileCheck %s --check-prefix=X32
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+sse2 | FileCheck %s --check-prefix=X64
3 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-sse3 | FileCheck %s --check-prefix=X64_BAD
4
5 ; Sibcall optimization of expanded libcalls.
6 ; rdar://8707777
7
8 define double @foo(double %a) nounwind readonly ssp {
9 entry:
10 ; X32: foo:
11 ; X32: jmp _sin$stub
12
13 ; X64: foo:
14 ; X64: jmp _sin
15   %0 = tail call double @sin(double %a) nounwind readonly
16   ret double %0
17 }
18
19 define float @bar(float %a) nounwind readonly ssp {
20 ; X32: bar:
21 ; X32: jmp _sinf$stub
22
23 ; X64: bar:
24 ; X64: jmp _sinf
25 entry:
26   %0 = tail call float @sinf(float %a) nounwind readonly
27   ret float %0
28 }
29
30 declare float @sinf(float) nounwind readonly
31
32 declare double @sin(double) nounwind readonly
33
34 ; rdar://10930395
35 %0 = type opaque
36
37 @"\01L_OBJC_SELECTOR_REFERENCES_2" = external hidden global i8*, section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
38
39 define hidden { double, double } @foo2(%0* %self, i8* nocapture %_cmd) uwtable optsize ssp {
40 ; X64_BAD: foo
41 ; X64_BAD: call
42 ; X64_BAD: call
43 ; X64_BAD: call
44   %1 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_2", align 8, !invariant.load !0
45   %2 = bitcast %0* %self to i8*
46   %3 = tail call { double, double } bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to { double, double } (i8*, i8*)*)(i8* %2, i8* %1) optsize
47   %4 = extractvalue { double, double } %3, 0
48   %5 = extractvalue { double, double } %3, 1
49   %6 = tail call double @floor(double %4) optsize
50   %7 = tail call double @floor(double %5) optsize
51   %insert.i.i = insertvalue { double, double } undef, double %6, 0
52   %insert5.i.i = insertvalue { double, double } %insert.i.i, double %7, 1
53   ret { double, double } %insert5.i.i
54 }
55
56 declare i8* @objc_msgSend(i8*, i8*, ...)
57
58 declare double @floor(double) optsize
59
60 !0 = metadata !{}