1 ; RUN: llc -mtriple armv7 -target-abi apcs -O0 -o - < %s \
2 ; RUN: | FileCheck %s -check-prefix CHECK-TAIL
3 ; RUN: llc -mtriple armv7 -target-abi apcs -O0 -disable-tail-calls -o - < %s \
4 ; RUN: | FileCheck %s -check-prefix CHECK-NO-TAIL
6 declare i32 @callee(i32 %i)
7 declare extern_weak fastcc void @callee_weak()
9 define i32 @caller(i32 %i) {
11 %r = tail call i32 @callee(i32 %i)
15 ; CHECK-TAIL-LABEL: caller
16 ; CHECK-TAIL: b callee
18 ; CHECK-NO-TAIL-LABEL: caller
19 ; CHECK-NO-TAIL: push {lr}
20 ; CHECK-NO-TAIL: bl callee
21 ; CHECK-NO-TAIL: pop {lr}
22 ; CHECK-NO-TAIL: bx lr
25 ; Weakly-referenced extern functions cannot be tail-called, as AAELF does
26 ; not define the behaviour of branch instructions to undefined weak symbols.
27 define fastcc void @caller_weak() {
28 ; CHECK-LABEL: caller_weak:
29 ; CHECK: bl callee_weak
30 tail call void @callee_weak()