X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fas%2Fas.cpp;h=c9bd3b4e08c05a6d7bc5ebb71b66a1fdb40d5216;hb=fe4f677a9752f90d6bd3d17cd513220d7fa09ec3;hp=7593cef4b0f125b21ce197a0866bfef7490c4e76;hpb=d4c7f2766bcf2cf87e562ea4e71cb4b54d81b74e;p=oota-llvm.git diff --git a/tools/as/as.cpp b/tools/as/as.cpp index 7593cef4b0f..c9bd3b4e08c 100644 --- a/tools/as/as.cpp +++ b/tools/as/as.cpp @@ -12,6 +12,7 @@ #include "llvm/Module.h" #include "llvm/Assembly/Parser.h" #include "llvm/Bytecode/Writer.h" +#include "llvm/Analysis/Verifier.h" #include "Support/CommandLine.h" #include "Support/Signals.h" #include @@ -43,6 +44,12 @@ int main(int argc, char **argv) { cerr << argv[0] << ": assembly didn't read correctly.\n"; return 1; } + + if (verifyModule(*M.get())) { + cerr << argv[0] << ": assembly parsed, but does not verify as correct!\n"; + return 1; + } + if (DumpAsm) cerr << "Here's the assembly:\n" << M.get();