summaryrefslogtreecommitdiff
path: root/test/CodeGen/PowerPC/thread-pointer.ll
diff options
context:
space:
mode:
authorMarcin Koscielnicki <koriakin@0x04.net>2016-04-26 10:37:22 +0000
committerMarcin Koscielnicki <koriakin@0x04.net>2016-04-26 10:37:22 +0000
commitadc800c659b8c8b388b8bbde1101ab8c45e8c695 (patch)
tree2a7bbdb8d9fb057a73fee73f55b6d8595ce3169f /test/CodeGen/PowerPC/thread-pointer.ll
parenteb83c9c5952e6d2f02887d1c0119f960c6ea585e (diff)
[PowerPC] Add support for llvm.thread.pointer
Differential Revision: http://reviews.llvm.org/D19304 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC/thread-pointer.ll')
-rw-r--r--test/CodeGen/PowerPC/thread-pointer.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/thread-pointer.ll b/test/CodeGen/PowerPC/thread-pointer.ll
new file mode 100644
index 00000000000..2e8282d8dfb
--- /dev/null
+++ b/test/CodeGen/PowerPC/thread-pointer.ll
@@ -0,0 +1,17 @@
+; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu | FileCheck %s --check-prefix=CHECK-32
+; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu | FileCheck %s --check-prefix=CHECK-64
+; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu | FileCheck %s --check-prefix=CHECK-64
+
+; Function Attrs: nounwind readnone
+declare i8* @llvm.thread.pointer() #1
+
+define i8* @thread_pointer() {
+; CHECK-32-LABEL: @thread_pointer
+; CHECK-32: mr 3, 2
+; CHECK-32: blr
+; CHECK-64-LABEL: @thread_pointer
+; CHECK-64: mr 3, 13
+; CHECK-64: blr
+ %1 = tail call i8* @llvm.thread.pointer()
+ ret i8* %1
+}