Fix a crash when ASTReader emits diagnostic when another one is in flight. Fixes rdar//9334563.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130162 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/PCH/modified-header-crash.c b/test/PCH/modified-header-crash.c
new file mode 100644
index 0000000..0b6dc7a
--- /dev/null
+++ b/test/PCH/modified-header-crash.c
@@ -0,0 +1,9 @@
+// Don't crash.
+
+// RUN: %clang_cc1 -DCAKE -x c-header %S/modified-header-crash.h -emit-pch -o %t
+// RUN: touch %S/modified-header-crash.h
+// RUN: not %clang_cc1 %s -include-pch %t -fsyntax-only
+
+void f(void) {
+ foo = 3;
+}
diff --git a/test/PCH/modified-header-crash.h b/test/PCH/modified-header-crash.h
new file mode 100644
index 0000000..971746e
--- /dev/null
+++ b/test/PCH/modified-header-crash.h
@@ -0,0 +1 @@
+int foo;