Avoid crashing if a directory has no pch files.

Should fix some of the bots that have assertions disabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187329 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp
index 60e6156..075fe93 100644
--- a/lib/Frontend/FrontendAction.cpp
+++ b/lib/Frontend/FrontendAction.cpp
@@ -455,6 +455,8 @@
 
 void ASTFrontendAction::ExecuteAction() {
   CompilerInstance &CI = getCompilerInstance();
+  if (!CI.hasPreprocessor())
+    return;
 
   // FIXME: Move the truncation aspect of this into Sema, we delayed this till
   // here so the source manager would be initialized.
diff --git a/test/PCH/badpch.c b/test/PCH/badpch.c
index 35e9c6e..c302329 100644
--- a/test/PCH/badpch.c
+++ b/test/PCH/badpch.c
@@ -1,5 +1,5 @@
 // RUN: not %clang_cc1 -fsyntax-only -include-pch %S/Inputs/badpch-empty.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-EMPTY %s
-// RUN: not --crash %clang_cc1 -fsyntax-only -include-pch %S/Inputs/badpch-dir.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-DIR %s
+// RUN: not %clang_cc1 -fsyntax-only -include-pch %S/Inputs/badpch-dir.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-DIR %s
 
 // The purpose of this test is to verify that various invalid PCH files are
 // reported as such.