summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-08-24 19:02:29 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-08-24 19:02:29 +0000
commit70c6a3976baf2c667b1525c43753987ae12bf672 (patch)
treece118a3a786d2bf09d06345afee4ea160ae34d2b
parent424fc7e6118abbfbc3b1485435948a4d5f307f45 (diff)
downloadbcm5719-llvm-70c6a3976baf2c667b1525c43753987ae12bf672.tar.gz
bcm5719-llvm-70c6a3976baf2c667b1525c43753987ae12bf672.zip
Use isTargetMachO instead of isTargetDarwin.
llvm-svn: 279655
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.cpp2
-rw-r--r--llvm/test/CodeGen/ARM/macho-extern-hidden.ll10
2 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.cpp b/llvm/lib/Target/ARM/ARMSubtarget.cpp
index b6e2b3aee17..469d340d122 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.cpp
+++ b/llvm/lib/Target/ARM/ARMSubtarget.cpp
@@ -282,7 +282,7 @@ bool ARMSubtarget::isGVIndirectSymbol(const GlobalValue *GV) const {
// 32 bit macho has no relocation for a-b if a is undefined, even if b is in
// the section that is being relocated. This means we have to use o load even
// for GVs that are known to be local to the dso.
- if (isTargetDarwin() && TM.isPositionIndependent() &&
+ if (isTargetMachO() && TM.isPositionIndependent() &&
(GV->isDeclarationForLinker() || GV->hasCommonLinkage()))
return true;
diff --git a/llvm/test/CodeGen/ARM/macho-extern-hidden.ll b/llvm/test/CodeGen/ARM/macho-extern-hidden.ll
new file mode 100644
index 00000000000..6a45f008bf3
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/macho-extern-hidden.ll
@@ -0,0 +1,10 @@
+; RUN: llc < %s -mtriple=thumbv7em-apple-unknown-macho | FileCheck %s
+
+; CHECK: movw r0, :lower16:(L_bar$non_lazy_ptr-(LPC0_0+4))
+; CHECK: movt r0, :upper16:(L_bar$non_lazy_ptr-(LPC0_0+4))
+
+@bar = external hidden global i32
+define i32 @foo() {
+ %tmp = load i32, i32* @bar, align 4
+ ret i32 %tmp
+}
OpenPOWER on IntegriCloud