Fix PR4639, a ELF-TLS regression from some of my refactoring.
authorChris Lattner <sabre@nondot.org>
Tue, 28 Jul 2009 17:57:51 +0000 (17:57 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 28 Jul 2009 17:57:51 +0000 (17:57 +0000)
llvm-svn: 77336

llvm/lib/Target/TargetLoweringObjectFile.cpp
llvm/test/CodeGen/X86/global-sections-tls.ll [new file with mode: 0644]

index 2074b6c..7bd6788 100644 (file)
@@ -354,7 +354,7 @@ getSectionFlagsAsString(SectionKind Kind, SmallVectorImpl<char> &Str) const {
     Str.push_back('@');
   
   const char *KindStr;
-  if (Kind.isBSS())
+  if (Kind.isBSS() || Kind.isThreadBSS())
     KindStr = "nobits";
   else
     KindStr = "progbits";
diff --git a/llvm/test/CodeGen/X86/global-sections-tls.ll b/llvm/test/CodeGen/X86/global-sections-tls.ll
new file mode 100644 (file)
index 0000000..a80cf32
--- /dev/null
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -mtriple=i386-unknown-linux-gnu | FileCheck %s -check-prefix=LINUX
+
+; PR4639
+@G1 = internal thread_local global i32 0               ; <i32*> [#uses=1]
+; LINUX: .section              .tbss,"awT",@nobits
+; LINUX: G1:
+
+
+define i32* @foo() nounwind readnone {
+entry:
+       ret i32* @G1
+}
+
+