Allow -parse-noop -verify options to be used together.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52249 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/DiagChecker.cpp b/Driver/DiagChecker.cpp
index c060267..643c17e 100644
--- a/Driver/DiagChecker.cpp
+++ b/Driver/DiagChecker.cpp
@@ -229,7 +229,11 @@
   
   // 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);
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 6f7e1a2..731c1a8 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -1134,6 +1134,9 @@
   // Parsing the specified input file.
   P.ParseTranslationUnit();
   delete PA;
+
+  if (VerifyDiagnostics)
+    exit(CheckDiagnostics(PP));
 }
 
 //===----------------------------------------------------------------------===//
diff --git a/Driver/clang.h b/Driver/clang.h
index 69434b7..ddb5dcb 100644
--- a/Driver/clang.h
+++ b/Driver/clang.h
@@ -43,6 +43,9 @@
 /// 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