summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/cxx11-thread-local-reference.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2015-11-11 22:42:31 +0000
committerManman Ren <manman.ren@gmail.com>2015-11-11 22:42:31 +0000
commitff855dea215a5fdb7478c49bf0ab183a420deb59 (patch)
tree14c469bb8a807686596e8286c84aa1cce4d2d911 /test/CodeGenCXX/cxx11-thread-local-reference.cpp
parent3f780d757ea28d90adba820d20b5182f0482278f (diff)
[TLS on Darwin] change how we handle globals with linkonce or weak linkage.
This is about how we handle static member of a template. Before this commit, we use internal linkage for the IR thread-local variable, which is inefficient. With this commit, we will start to follow Itanium C++ ABI. rdar://problem/23415206 Reviewed by John McCall. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/cxx11-thread-local-reference.cpp')
-rw-r--r--test/CodeGenCXX/cxx11-thread-local-reference.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/CodeGenCXX/cxx11-thread-local-reference.cpp b/test/CodeGenCXX/cxx11-thread-local-reference.cpp
index 2d74120000..a1efd1adb3 100644
--- a/test/CodeGenCXX/cxx11-thread-local-reference.cpp
+++ b/test/CodeGenCXX/cxx11-thread-local-reference.cpp
@@ -1,11 +1,14 @@
-// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck --check-prefix=CHECK --check-prefix=LINUX %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-apple-darwin12 | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
int &f();
-// CHECK: @r = thread_local global i32* null
+// LINUX: @r = thread_local global i32* null
+// DARWIN: @r = internal thread_local global i32* null
thread_local int &r = f();
-// CHECK: @_ZTH1r = alias void (), void ()* @__tls_init
+// LINUX: @_ZTH1r = alias void (), void ()* @__tls_init
+// DARWIN: @_ZTH1r = internal alias void (), void ()* @__tls_init
int &g() { return r; }
@@ -17,7 +20,8 @@ int &g() { return r; }
// CHECK: call i32* @_ZTW1r()
// CHECK: ret i32* %{{.*}}
-// CHECK: define weak_odr hidden i32* @_ZTW1r() {
+// LINUX: define weak_odr hidden i32* @_ZTW1r() {
+// DARWIN: define i32* @_ZTW1r() {
// CHECK: call void @_ZTH1r()
// CHECK: load i32*, i32** @r, align 8
// CHECK: ret i32* %{{.*}}