Extended Description
Tested at r316607 on release_50.
==> a.cpp <==
int* A();
int main() {
int* s(A());
}
==> b.cpp <==
struct SF {
SF();
};
SF::SF() {}
SF* A() {
new SF();
}
$ clang -o a.o -flto=thin -c a.cpp
$ clang -o b.o -flto=thin -c b.cpp
$ llvm-lto a.o b.o --thinlto-action=run
llvm-lto: .../llvm/lib/IR/Globals.cpp:317: llvm::GlobalVariable::GlobalVariable(llvm::Module&, llvm::Type*, bool, llvm::GlobalValue::LinkageTypes, llvm::Constant*, const llvm::Twine&, llvm::GlobalVariable*, llvm::GlobalValue::ThreadLocalMode, unsigned int, bool): Assertion `!Ty->isFunctionTy() && PointerType::isValidElementType(Ty) && "invalid type for global variable"' failed.
Not seen on master (r317500).
Note that there are multiple versions of A() in this example. With this fixed, there is no assertion failure.
Extended Description
Tested at r316607 on release_50.
==> a.cpp <==
int* A();
int main() {
int* s(A());
}
==> b.cpp <==
struct SF {
SF();
};
SF::SF() {}
SF* A() {
new SF();
}
$ clang -o a.o -flto=thin -c a.cpp
$ clang -o b.o -flto=thin -c b.cpp
$ llvm-lto a.o b.o --thinlto-action=run
llvm-lto: .../llvm/lib/IR/Globals.cpp:317: llvm::GlobalVariable::GlobalVariable(llvm::Module&, llvm::Type*, bool, llvm::GlobalValue::LinkageTypes, llvm::Constant*, const llvm::Twine&, llvm::GlobalVariable*, llvm::GlobalValue::ThreadLocalMode, unsigned int, bool): Assertion `!Ty->isFunctionTy() && PointerType::isValidElementType(Ty) && "invalid type for global variable"' failed.
Not seen on master (r317500).
Note that there are multiple versions of A() in this example. With this fixed, there is no assertion failure.