aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/CodeGenModule.cpp3
-rw-r--r--test/CodeGen/thread-specifier.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index fdd3568472..5a10602589 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -1479,7 +1479,8 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName,
}
if (D->getTLSKind()) {
- CXXThreadLocals.push_back(std::make_pair(D, GV));
+ if (D->getTLSKind() == VarDecl::TLS_Dynamic)
+ CXXThreadLocals.push_back(std::make_pair(D, GV));
setTLSMode(GV, *D);
}
}
diff --git a/test/CodeGen/thread-specifier.c b/test/CodeGen/thread-specifier.c
index a2d3e62c8c..8e21651cd8 100644
--- a/test/CodeGen/thread-specifier.c
+++ b/test/CodeGen/thread-specifier.c
@@ -10,6 +10,9 @@
// CHECK: @i = thread_local(initialexec) global
// CHECK: @j = thread_local(localexec) global
+// CHECK-NOT: @_ZTW
+// CHECK-NOT: @_ZTH
+
__thread int a;
extern __thread int b;
int c() { return *&b; }