summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/tail-call.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/ARM/tail-call.ll')
-rw-r--r--test/CodeGen/ARM/tail-call.ll15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/CodeGen/ARM/tail-call.ll b/test/CodeGen/ARM/tail-call.ll
index 771158632ecf..ca19b057773a 100644
--- a/test/CodeGen/ARM/tail-call.ll
+++ b/test/CodeGen/ARM/tail-call.ll
@@ -1,8 +1,10 @@
-; RUN: llc -mtriple armv7 -O0 -o - < %s | FileCheck %s -check-prefix CHECK-TAIL
-; RUN: llc -mtriple armv7 -O0 -disable-tail-calls -o - < %s \
+; RUN: llc -mtriple armv7 -target-abi apcs -O0 -o - < %s \
+; RUN: | FileCheck %s -check-prefix CHECK-TAIL
+; RUN: llc -mtriple armv7 -target-abi apcs -O0 -disable-tail-calls -o - < %s \
; RUN: | FileCheck %s -check-prefix CHECK-NO-TAIL
declare i32 @callee(i32 %i)
+declare extern_weak fastcc void @callee_weak()
define i32 @caller(i32 %i) {
entry:
@@ -19,3 +21,12 @@ entry:
; CHECK-NO-TAIL: pop {lr}
; CHECK-NO-TAIL: bx lr
+
+; Weakly-referenced extern functions cannot be tail-called, as AAELF does
+; not define the behaviour of branch instructions to undefined weak symbols.
+define fastcc void @caller_weak() {
+; CHECK-LABEL: caller_weak:
+; CHECK: bl callee_weak
+ tail call void @callee_weak()
+ ret void
+}