abort when we lower an initializer to the wrong type, as we currently do for:

char text[] = "string";

llvm-svn: 44752
This commit is contained in:
Chris Lattner 2007-12-10 00:05:55 +00:00
parent 686628e052
commit cb04ac9599
1 changed files with 2 additions and 2 deletions

View File

@ -488,8 +488,8 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) {
if (!Init)
Init = EmitGlobalInit(D->getInit());
assert(Init && "FIXME: Global variable initializers unimp!");
assert(GV->getType()->getElementType() == Init->getType() &&
"Initializer codegen type mismatch!");
GV->setInitializer(Init);
// Set the llvm linkage type as appropriate.