summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/cxx11-thread-local.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-05-05 18:54:23 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-05-05 18:54:23 +0000
commita9cf72f94dab05055ac4b83c347a006ead632b82 (patch)
treef1a5960bb14f563050c2eda5d0ffbae677fc23ba /test/CodeGenCXX/cxx11-thread-local.cpp
parentfdea112f9cca521ca1d92820cfb12109d63def04 (diff)
CodeGen: Assign linkage to thread-wrappers correctly
We would sometimes incorrectly give a thread-wrapper external linkage instead of internal linkage if we had only CodeGen'd it's declaration, not it's definition. This fixes PR19655. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207988 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/cxx11-thread-local.cpp')
-rw-r--r--test/CodeGenCXX/cxx11-thread-local.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGenCXX/cxx11-thread-local.cpp b/test/CodeGenCXX/cxx11-thread-local.cpp
index b91f46d5d4..5843a343b8 100644
--- a/test/CodeGenCXX/cxx11-thread-local.cpp
+++ b/test/CodeGenCXX/cxx11-thread-local.cpp
@@ -145,6 +145,14 @@ int PR19254::f() {
return this->n;
}
+namespace {
+thread_local int anon_i{1};
+}
+void set_anon_i() {
+ anon_i = 2;
+}
+// CHECK-LABEL: define internal hidden i32* @_ZTWN12_GLOBAL__N_16anon_iE()
+
// CHECK: define {{.*}} @[[V_M_INIT:.*]]()
// CHECK: load i8* bitcast (i64* @_ZGVN1VIiE1mE to i8*)
// CHECK: %[[V_M_INITIALIZED:.*]] = icmp eq i8 %{{.*}}, 0