summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/modified-header-error.c
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-06-01 05:43:53 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-06-01 05:43:53 +0000
commit460132d35ce36d8dc9701035d97f23d13dcb91f7 (patch)
tree6a8dd52a76665328ae2da07936497477469f3600 /clang/test/PCH/modified-header-error.c
parent9f20804216ef49f4c904bce812b390da33c297c9 (diff)
downloadbcm5719-llvm-460132d35ce36d8dc9701035d97f23d13dcb91f7.tar.gz
bcm5719-llvm-460132d35ce36d8dc9701035d97f23d13dcb91f7.zip
[PCH] Be conservative and check all the files the PCH references to see if
a file was modified since the time the PCH was created. The parser is not fit to deal with stale PCHs, too many invariants do not hold up. rdar://9530587. llvm-svn: 132389
Diffstat (limited to 'clang/test/PCH/modified-header-error.c')
-rw-r--r--clang/test/PCH/modified-header-error.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/PCH/modified-header-error.c b/clang/test/PCH/modified-header-error.c
new file mode 100644
index 00000000000..6335fb1b453
--- /dev/null
+++ b/clang/test/PCH/modified-header-error.c
@@ -0,0 +1,11 @@
+// RUN: mkdir -p %t.dir
+// RUN: echo '#include "header2.h"' > %t.dir/header1.h
+// RUN: echo > %t.dir/header2.h
+// RUN: cp %s %t.dir/t.c
+// RUN: %clang_cc1 -x c-header %t.dir/header1.h -emit-pch -o %t.pch
+// RUN: echo >> %t.dir/header2.h
+// RUN: %clang_cc1 %t.dir/t.c -include-pch %t.pch -fsyntax-only 2>&1 | FileCheck %s
+
+#include "header2.h"
+
+// CHECK: fatal error: file {{.*}} has been modified since the precompiled header was built
OpenPOWER on IntegriCloud