Fix bug: CBackend/2003-06-28-LinkOnceGlobalVars.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6931 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index b360140..739e270 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -682,6 +682,8 @@
if (I->hasInternalLinkage())
Out << "static ";
printType(Out, I->getType()->getElementType(), getValueName(I));
+ if (I->hasLinkOnceLinkage())
+ Out << " __attribute__((common))";
if (!I->getInitializer()->isNullValue()) {
Out << " = " ;
writeOperand(I->getInitializer());