]> granicus.if.org Git - clang/commitdiff
Tentative declarations are supposed to have common linkage, not weak.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 29 May 2008 11:03:17 +0000 (11:03 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 29 May 2008 11:03:17 +0000 (11:03 +0000)
This change makes clang generate the same thing as llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51674 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp
test/CodeGen/weak-global.c

index 525c13fc96bb403c33e3a5b91a3ce203d823d78e..0b7d30ac50010e0ff263010aa47499d9c928935b 100644 (file)
@@ -500,7 +500,7 @@ void CodeGenModule::EmitGlobalVarInit(const VarDecl *D) {
       assert(0 && "Can't have auto or register globals");
     case VarDecl::None:
       if (!D->getInit())
-        GV->setLinkage(llvm::GlobalVariable::WeakLinkage);
+        GV->setLinkage(llvm::GlobalVariable::CommonLinkage);
       break;
     case VarDecl::Extern:
     case VarDecl::PrivateExtern:
index 86e551c1ead50b1d0dddd156d4c7b97f97fd0a74..d19dd6129179971c870215b4770ce2f4cd32b401 100644 (file)
@@ -1,3 +1,3 @@
-// RUN: clang -emit-llvm < %s | grep weak
+// RUN: clang -emit-llvm < %s | grep common
 
 int i;