summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2009-04-17 14:35:58 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2009-04-17 14:35:58 +0000
commit2ee3db3003deb18461a72b82166d8d417925d06f (patch)
treed1a8eb3f3638affbe0742ce8652d4e4f122ab599 /test/CodeGen
parentc3a76ef9553a2e89a18eab9d052052305e69fc93 (diff)
downloadllvm-2ee3db3003deb18461a72b82166d8d417925d06f.tar.gz
llvm-2ee3db3003deb18461a72b82166d8d417925d06f.tar.bz2
llvm-2ee3db3003deb18461a72b82166d8d417925d06f.tar.xz
For general dynamic TLS access we must use
leaq foo@TLSGD(%rip), %rdi as part of the instruction sequence. Using a register other than %rdi and then copying it to %rdi is not valid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69350 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/2009-04-17-tls-fast.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2009-04-17-tls-fast.ll b/test/CodeGen/X86/2009-04-17-tls-fast.ll
new file mode 100644
index 0000000000..6a8054eae2
--- /dev/null
+++ b/test/CodeGen/X86/2009-04-17-tls-fast.ll
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu -relocation-model=pic -regalloc=local > %t
+; RUN: grep {leaq foo@TLSGD(%rip), %rdi} %t
+
+@foo = internal thread_local global i32 100
+
+define void @f(i32 %n) nounwind {
+entry:
+ %n_addr = alloca i32
+ %p = alloca i32*
+ %"alloca point" = bitcast i32 0 to i32
+ store i32 %n, i32* %n_addr
+ store i32* @foo, i32** %p, align 8
+ br label %return
+
+return:
+ ret void
+}