fix test/Regression/CodeGen/X86/weak.ll

if a variable has no initialization, I->getInitializer() will fail


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32407 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2006-12-09 23:14:08 +00:00
parent 5b24426375
commit 3e69a7e527
2 changed files with 4 additions and 1 deletions

View File

@ -132,7 +132,7 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
// Print out module-level global variables here.
for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I) {
if (!I->hasInitializer() && !I->hasExternalWeakLinkage())
if (!I->hasInitializer())
continue; // External global require no code
// Check to see if this is a special global used by LLVM, if so, emit it.

3
test/CodeGen/X86/weak.ll Normal file
View File

@ -0,0 +1,3 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
%a = extern_weak global int
%b = global int* %a