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=CHECKT2
5 @t = weak global i32 ()* null ; <i32 ()**> [#uses=1]
7 declare void @g(i32, i32, i32, i32)
12 call void @g( i32 1, i32 2, i32 3, i32 4 )
18 ; CHECKV6: bx r0 @ TAILCALL
19 %tmp = load i32 ()** @t ; <i32 ()*> [#uses=1]
20 %tmp.upgrd.2 = tail call i32 %tmp( ) ; <i32> [#uses=0]
26 ; CHECKV6: b _t2 @ TAILCALL
28 ; CHECKELF: b t2(PLT) @ TAILCALL
29 tail call void @t2( ) ; <i32> [#uses=0]
33 ; Sibcall optimization of expanded libcalls. rdar://8707777
34 define double @t4(double %a) nounwind readonly ssp {
37 ; CHECKV6: b _sin @ TAILCALL
39 ; CHECKELF: b sin(PLT) @ TAILCALL
40 %0 = tail call double @sin(double %a) nounwind readonly ; <double> [#uses=1]
44 define float @t5(float %a) nounwind readonly ssp {
47 ; CHECKV6: b _sinf @ TAILCALL
49 ; CHECKELF: b sinf(PLT) @ TAILCALL
50 %0 = tail call float @sinf(float %a) nounwind readonly ; <float> [#uses=1]
54 declare float @sinf(float) nounwind readonly
56 declare double @sin(double) nounwind readonly
58 define i32 @t6(i32 %a, i32 %b) nounwind readnone {
61 ; CHECKV6: b ___divsi3 @ TAILCALL
63 ; CHECKELF: b __aeabi_idiv(PLT) @ TAILCALL
68 ; Make sure the tail call instruction isn't deleted
70 declare void @foo() nounwind
72 define void @t7() nounwind {
77 ; CHECKT2-NEXT: b.w _foo
78 br i1 undef, label %bb, label %bb1.lr.ph
81 tail call void @foo() nounwind
85 tail call void @foo() nounwind