1 ; RUN: llc < %s -mtriple=armv6-apple-darwin -mattr=+vfp2 -arm-tail-calls | FileCheck %s -check-prefix=CHECKV6
2 ; RUN: llc < %s -mtriple=armv6-linux-gnueabi -relocation-model=pic -mattr=+vfp2 -arm-tail-calls | FileCheck %s -check-prefix=CHECKELF
3 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -arm-tail-calls | FileCheck %s -check-prefix=CHECKT2D
4 ; RUN: llc < %s -mtriple=thumbv7-apple-ios5.0 | FileCheck %s -check-prefix=CHECKT2D
6 ; Enable tailcall optimization for iOS 5.0
9 @t = weak global i32 ()* null ; <i32 ()**> [#uses=1]
11 declare void @g(i32, i32, i32, i32)
16 call void @g( i32 1, i32 2, i32 3, i32 4 )
26 ; CHECKT2D-NEXT: bx r0
27 %tmp = load i32 ()** @t ; <i32 ()*> [#uses=1]
28 %tmp.upgrd.2 = tail call i32 %tmp( ) ; <i32> [#uses=0]
40 tail call void @t2( ) ; <i32> [#uses=0]
44 ; Sibcall optimization of expanded libcalls. rdar://8707777
45 define double @t4(double %a) nounwind readonly ssp {
50 ; CHECKELF: b sin(PLT)
51 %0 = tail call double @sin(double %a) nounwind readonly ; <double> [#uses=1]
55 define float @t5(float %a) nounwind readonly ssp {
60 ; CHECKELF: b sinf(PLT)
61 %0 = tail call float @sinf(float %a) nounwind readonly ; <float> [#uses=1]
65 declare float @sinf(float) nounwind readonly
67 declare double @sin(double) nounwind readonly
69 define i32 @t6(i32 %a, i32 %b) nounwind readnone {
72 ; CHECKV6: b ___divsi3
74 ; CHECKELF: b __aeabi_idiv(PLT)
79 ; Make sure the tail call instruction isn't deleted
81 declare void @foo() nounwind
83 define void @t7() nounwind {
86 ; CHECKT2D: blxeq _foo
87 ; CHECKT2D-NEXT: pop.w
88 ; CHECKT2D-NEXT: b.w _foo
89 br i1 undef, label %bb, label %bb1.lr.ph
92 tail call void @foo() nounwind
96 tail call void @foo() nounwind