// Parse the AST and run the consumer, ultimately deleting C.
ParseAST(PP, C);
-
+ return CheckDiagnostics(PP);
+}
+
+/// CheckDiagnostics - Gather the expected diagnostics and check them.
+bool clang::CheckDiagnostics(Preprocessor &PP) {
// Gather the set of expected diagnostics.
DiagList ExpectedErrors, ExpectedWarnings;
FindExpectedDiags(PP, ExpectedErrors, ExpectedWarnings);
// Parsing the specified input file.
P.ParseTranslationUnit();
delete PA;
+
+ if (VerifyDiagnostics)
+ exit(CheckDiagnostics(PP));
}
//===----------------------------------------------------------------------===//
/// CheckASTConsumer - Implement diagnostic checking for AST consumers.
bool CheckASTConsumer(Preprocessor &PP, ASTConsumer* C);
+/// CheckDiagnostics - Gather the expected diagnostics and check them.
+bool CheckDiagnostics(Preprocessor &PP);
+
} // end namespace clang