summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/fast-isel-pie.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/ARM/fast-isel-pie.ll')
-rw-r--r--llvm/test/CodeGen/ARM/fast-isel-pie.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/fast-isel-pie.ll b/llvm/test/CodeGen/ARM/fast-isel-pie.ll
new file mode 100644
index 00000000000..23a88bdaa22
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/fast-isel-pie.ll
@@ -0,0 +1,19 @@
+; RUN: llc < %s -O0 -fast-isel-abort=1 -relocation-model=pic -mtriple=armv7-pc-linux-gnueabi | FileCheck %s
+
+@var = global i32 42
+
+define i32* @foo() {
+; CHECK: foo:
+; CHECK: ldr r0, .L[[POOL:.*]]
+; CHECK-NEXT: .L[[ADDR:.*]]:
+; CHECK-NEXT: add r0, pc, r0
+; CHECK-NEXT: bx lr
+
+; CHECK: .L[[POOL]]:
+; CHECK-NEXT: .long var-(.L[[ADDR]]+8)
+
+ ret i32* @var
+}
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 1, !"PIE Level", i32 2}
OpenPOWER on IntegriCloud