diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-28 18:15:43 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-28 18:15:43 +0000 |
| commit | 59f7eba2b546e4118434b0ea9de5e08c316a64b1 (patch) | |
| tree | 16f393a8b64f8652acb4a735aa2b8dc81c8fa064 /llvm/test | |
| parent | 555132824a9e28993a22c1fb1933287999d5733a (diff) | |
| download | bcm5719-llvm-59f7eba2b546e4118434b0ea9de5e08c316a64b1.tar.gz bcm5719-llvm-59f7eba2b546e4118434b0ea9de5e08c316a64b1.zip | |
[pr19844] Add thread local mode to aliases.
This matches gcc's behavior. It also seems natural given that aliases
contain other properties that govern how it is accessed (linkage,
visibility, dll storage).
Clang still has to be updated to expose this feature to C.
llvm-svn: 209759
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/Mips/tls-alias.ll | 2 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll | 2 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/aliases.ll | 18 | ||||
| -rw-r--r-- | llvm/test/Feature/alias2.ll | 3 |
4 files changed, 22 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/Mips/tls-alias.ll b/llvm/test/CodeGen/Mips/tls-alias.ll index 80fbe87a8d6..b61f84e0376 100644 --- a/llvm/test/CodeGen/Mips/tls-alias.ll +++ b/llvm/test/CodeGen/Mips/tls-alias.ll @@ -1,7 +1,7 @@ ; RUN: llc -march=mipsel -relocation-model=pic -disable-mips-delay-filler < %s | FileCheck %s @foo = thread_local global i32 42 -@bar = hidden alias i32* @foo +@bar = hidden thread_local alias i32* @foo define i32* @zed() { ; CHECK-DAG: __tls_get_addr diff --git a/llvm/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll b/llvm/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll index e64375a2b36..a0106d7798d 100644 --- a/llvm/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll +++ b/llvm/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll @@ -8,7 +8,7 @@ target triple = "i386-pc-linux-gnu" @__resp = thread_local global %struct.__res_state* @_res ; <%struct.__res_state**> [#uses=1] @_res = global %struct.__res_state zeroinitializer, section ".bss" ; <%struct.__res_state*> [#uses=1] -@__libc_resp = hidden alias %struct.__res_state** @__resp ; <%struct.__res_state**> [#uses=2] +@__libc_resp = hidden thread_local alias %struct.__res_state** @__resp ; <%struct.__res_state**> [#uses=2] define i32 @foo() { ; CHECK-LABEL: foo: diff --git a/llvm/test/CodeGen/X86/aliases.ll b/llvm/test/CodeGen/X86/aliases.ll index 8487c6082b7..d207880d660 100644 --- a/llvm/test/CodeGen/X86/aliases.ll +++ b/llvm/test/CodeGen/X86/aliases.ll @@ -1,4 +1,20 @@ -; RUN: llc < %s -mtriple=i686-pc-linux-gnu -asm-verbose=false | FileCheck %s +; RUN: llc < %s -mtriple=i686-pc-linux-gnu -asm-verbose=false \ +; RUN: -relocation-model=pic | FileCheck %s + +@thread_var = thread_local global i32 42, align 4 +@thread_alias = thread_local(localdynamic) alias i32* @thread_var + +; CHECK-LABEL: get_thread_var +define i32* @get_thread_var() { +; CHECK: leal thread_var@TLSGD + ret i32* @thread_var +} + +; CHECK-LABEL: get_thread_alias +define i32* @get_thread_alias() { +; CHECK: leal thread_alias@TLSLD + ret i32* @thread_alias +} @bar = global i32 42 diff --git a/llvm/test/Feature/alias2.ll b/llvm/test/Feature/alias2.ll index 693ef7c9bef..4334a620171 100644 --- a/llvm/test/Feature/alias2.ll +++ b/llvm/test/Feature/alias2.ll @@ -17,3 +17,6 @@ @v6 = alias i16, i32* @v1 ; CHECK: @v6 = alias i16, i32* @v1 + +@v7 = thread_local(localdynamic) alias i32* @v1 +; CHECK: @v7 = thread_local(localdynamic) alias i32* @v1 |

