summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-05-31 15:31:55 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-05-31 15:31:55 +0000
commit7ad97b2fe42e32344ff81ea09368f029e3300f97 (patch)
tree4e218b0f0a4bc109d7168277c04d7fcbd239f9c1 /llvm/test/CodeGen/ARM
parente93a73fb7aa49d04f1109e6c3c69530ea6d81d31 (diff)
downloadbcm5719-llvm-7ad97b2fe42e32344ff81ea09368f029e3300f97.tar.gz
bcm5719-llvm-7ad97b2fe42e32344ff81ea09368f029e3300f97.zip
Add a use of shouldAssumeDSOLocal to ARM.
Now this code path knows about position independent executables. llvm-svn: 271290
Diffstat (limited to 'llvm/test/CodeGen/ARM')
-rw-r--r--llvm/test/CodeGen/ARM/pie.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/pie.ll b/llvm/test/CodeGen/ARM/pie.ll
new file mode 100644
index 00000000000..1b1e6e62fda
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/pie.ll
@@ -0,0 +1,18 @@
+; RUN: llc -mtriple=armv7-pc-linux-gnueabi -relocation-model=pic < %s | FileCheck %s
+
+@foo = global i32 42
+
+define i32* @get_foo() {
+ ret i32* @foo
+}
+
+; Test that we only use one load. Even that is only needed because there
+; doesn't seem to be pc relative relocations for movw movt.
+; CHECK: ldr r0, .LCPI0_0
+; CHECK-NEXT: .L{{.*}}:
+; CHECK-NEXT: add r0, pc, r0
+; CHECK-NEXT: bx lr
+
+!llvm.module.flags = !{!0}
+
+!0 = !{i32 1, !"PIE Level", i32 2}
OpenPOWER on IntegriCloud