A global without initializer must be emitted as weak.
Fix Olden/bh test. llvm-svn: 47292
This commit is contained in:
parent
6200c225e0
commit
c58fc4052e
|
@ -244,6 +244,9 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) {
|
|||
case VarDecl::Register:
|
||||
assert(0 && "Can't have auto or register globals");
|
||||
case VarDecl::None:
|
||||
if (!D->getInit())
|
||||
GV->setLinkage(llvm::GlobalVariable::WeakLinkage);
|
||||
break;
|
||||
case VarDecl::Extern:
|
||||
case VarDecl::PrivateExtern:
|
||||
// todo: common
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
// RUN: clang -emit-llvm < %s | grep weak
|
||||
|
||||
int i;
|
Loading…
Reference in New Issue