summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2017-08-18 19:13:56 +0000
committerTim Northover <tnorthover@apple.com>2017-08-18 19:13:56 +0000
commit14302fcb247673fe3a5a9b2b18dbb3e93de12ba7 (patch)
tree89ad453a40ac95fd5239df6be23a9d78fb61417c /llvm/test/CodeGen/ARM
parent5c7fc76983f609894c1b24f6c03195a5db00d718 (diff)
downloadbcm5719-llvm-14302fcb247673fe3a5a9b2b18dbb3e93de12ba7.tar.gz
bcm5719-llvm-14302fcb247673fe3a5a9b2b18dbb3e93de12ba7.zip
ARM: use an external relocation for calls from MachO ARM mode.
The internal (__text-relative) relocation risks the offset not being encodable if the destination is Thumb. llvm-svn: 311187
Diffstat (limited to 'llvm/test/CodeGen/ARM')
-rw-r--r--llvm/test/CodeGen/ARM/arm-macho-tail.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/arm-macho-tail.ll b/llvm/test/CodeGen/ARM/arm-macho-tail.ll
new file mode 100644
index 00000000000..8c9b988ea78
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/arm-macho-tail.ll
@@ -0,0 +1,16 @@
+; RUN: llc -mtriple=thumbv7-apple-watchos %s -filetype=obj -o %t
+; RUN: llvm-objdump -r %t | FileCheck %s
+
+ ; Relocation needs to explicitly mention _bar rather than be __text relative
+ ; because the __text relative offset is not encodable in an ARM instruction.
+; CHECK: ARM_RELOC_BR24 _bar
+define void @foo() "target-features"="-thumb-mode" {
+ tail call void @bar()
+ ret void
+}
+
+define void @one_inst() { ret void }
+
+define void @bar() {
+ ret void
+}
OpenPOWER on IntegriCloud