- Nice if -verify test exercise the various cleanup functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58285
91177308-0d34-0410-b5e6-
96231b3b80d8
ParseAST(PP, Consumer.get(), Stats, !DisableFree);
if (VerifyDiagnostics)
- exit(CheckDiagnostics(PP));
+ if (CheckDiagnostics(PP))
+ exit(1);
if (Stats) {
fprintf(stderr, "\nSTATISTICS FOR '%s':\n", InFile.c_str());
fprintf(stderr, "\n");
}
+ // If verifying diagnostics and we reached here, all is well.
+ if (VerifyDiagnostics)
+ return 0;
+
return HadErrors || (Diags.getNumErrors() != 0);
}