[X86][SSE] Added tests for i8/i16 vector shifts
[oota-llvm.git] / test / CodeGen / ARM / tail-call.ll
index 270b41d956d4ee0600c3da2f35bcc515e5acecbc..ca19b057773a8a31f1efc4d751fa859ed94e76bd 100644 (file)
@@ -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:
@@ -10,12 +12,21 @@ entry:
   ret i32 %r
 }
 
-; CHECK-LABEL: caller
+; CHECK-TAIL-LABEL: caller
 ; CHECK-TAIL: b callee
 
-; CHECK-LABEL: caller
+; CHECK-NO-TAIL-LABEL: caller
 ; CHECK-NO-TAIL: push {lr}
 ; CHECK-NO-TAIL: bl callee
 ; 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
+}