From 041ceb7d57d81c34d530ca50d947857facb6f40f Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 25 Mar 2015 23:22:10 +0000 Subject: llvm-link: Verify input modules Otherwise, broken input modules can cause assertions. I've updated two of the testcases that started failing (modules that had `Require` flags but didn't meet their own requirements), but Rafael and I decided that test/Linker/2011-08-22-ResolveAlias.ll should just be deleted outright -- it's a leftover of the way llvm-gcc used to implement weakref. llvm-svn: 233229 --- llvm/tools/llvm-link/llvm-link.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/tools/llvm-link') diff --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp index 4348dae0aeb..e52191a267b 100644 --- a/llvm/tools/llvm-link/llvm-link.cpp +++ b/llvm/tools/llvm-link/llvm-link.cpp @@ -112,6 +112,12 @@ int main(int argc, char **argv) { return 1; } + if (verifyModule(*M)) { + errs() << argv[0] << ": input module '" << InputFilenames[i] + << "' is broken!\n"; + return 1; + } + if (Verbose) errs() << "Linking in '" << InputFilenames[i] << "'\n"; if (L.linkInModule(M.get())) -- cgit v1.2.3