aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/tls-pic.ll
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-10-14 17:57:32 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-10-14 17:57:32 +0000
commit59850d0874429601812bc13408cb1f776649027c (patch)
treeb21f6de4e08b89bb7931806bab798fc2a5e3a686 /test/CodeGen/X86/tls-pic.ll
parent18f153bdb9db52e7089a2d5293b96c45a3124a26 (diff)
downloadsrc-59850d0874429601812bc13408cb1f776649027c.tar.gz
src-59850d0874429601812bc13408cb1f776649027c.zip
Update llvm to r84119.vendor/llvm/llvm-r84119
Notes
Notes: svn path=/vendor/llvm/dist/; revision=198090 svn path=/vendor/llvm/llvm-84119/; revision=198091; tag=vendor/llvm/llvm-r84119
Diffstat (limited to 'test/CodeGen/X86/tls-pic.ll')
-rw-r--r--test/CodeGen/X86/tls-pic.ll67
1 files changed, 67 insertions, 0 deletions
diff --git a/test/CodeGen/X86/tls-pic.ll b/test/CodeGen/X86/tls-pic.ll
new file mode 100644
index 000000000000..4cad8376d8d9
--- /dev/null
+++ b/test/CodeGen/X86/tls-pic.ll
@@ -0,0 +1,67 @@
+; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic | FileCheck -check-prefix=X32 %s
+; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu -relocation-model=pic | FileCheck -check-prefix=X64 %s
+
+@i = thread_local global i32 15
+
+define i32 @f1() {
+entry:
+ %tmp1 = load i32* @i
+ ret i32 %tmp1
+}
+
+; X32: f1:
+; X32: leal i@TLSGD(,%ebx), %eax
+; X32: call ___tls_get_addr@PLT
+
+; X64: f1:
+; X64: leaq i@TLSGD(%rip), %rdi
+; X64: call __tls_get_addr@PLT
+
+
+@i2 = external thread_local global i32
+
+define i32* @f2() {
+entry:
+ ret i32* @i
+}
+
+; X32: f2:
+; X32: leal i@TLSGD(,%ebx), %eax
+; X32: call ___tls_get_addr@PLT
+
+; X64: f2:
+; X64: leaq i@TLSGD(%rip), %rdi
+; X64: call __tls_get_addr@PLT
+
+
+
+define i32 @f3() {
+entry:
+ %tmp1 = load i32* @i ; <i32> [#uses=1]
+ ret i32 %tmp1
+}
+
+; X32: f3:
+; X32: leal i@TLSGD(,%ebx), %eax
+; X32: call ___tls_get_addr@PLT
+
+; X64: f3:
+; X64: leaq i@TLSGD(%rip), %rdi
+; X64: call __tls_get_addr@PLT
+
+
+define i32* @f4() nounwind {
+entry:
+ ret i32* @i
+}
+
+; X32: f4:
+; X32: leal i@TLSGD(,%ebx), %eax
+; X32: call ___tls_get_addr@PLT
+
+; X64: f4:
+; X64: leaq i@TLSGD(%rip), %rdi
+; X64: call __tls_get_addr@PLT
+
+
+