summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/remap-file-from-pch.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-05-03 21:50:39 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-05-03 21:50:39 +0000
commit6eec06d0d4fa2e108546b422619c6cb32f234e6e (patch)
tree90747a8a081ee31c93799c847f17b5625c9b9f80 /clang/test/PCH/remap-file-from-pch.cpp
parent2e7f638b23788c0efc611cc68ca7747c0ad9afed (diff)
downloadbcm5719-llvm-6eec06d0d4fa2e108546b422619c6cb32f234e6e.tar.gz
bcm5719-llvm-6eec06d0d4fa2e108546b422619c6cb32f234e6e.zip
[PCH] When validating that the files coming from PCH did not change, also
validate that we didn't override the contents of any of such files. If this is detected, emit a diagnostic error and recover gracefully by using the contents of the original file that the PCH was built from. Part of rdar://11305263 llvm-svn: 156107
Diffstat (limited to 'clang/test/PCH/remap-file-from-pch.cpp')
-rw-r--r--clang/test/PCH/remap-file-from-pch.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/PCH/remap-file-from-pch.cpp b/clang/test/PCH/remap-file-from-pch.cpp
new file mode 100644
index 00000000000..f8a4cbe5c65
--- /dev/null
+++ b/clang/test/PCH/remap-file-from-pch.cpp
@@ -0,0 +1,10 @@
+// %clang_cc1 -remap-file "%s;%S/Inputs/remapped-file" -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXIST %s
+
+// RUN: %clang_cc1 -x c++-header %s.h -emit-pch -o %t.pch
+// RUN: %clang_cc1 %s -include-pch %t.pch -remap-file "%s.h;%s.remap.h" -fsyntax-only 2>&1 | FileCheck %s
+
+const char *str = STR;
+int ge = zool;
+
+// CHECK: file '{{.*}}/remap-file-from-pch.cpp.h' from the precompiled header has been overridden
+// CHECK: use of undeclared identifier 'zool'
OpenPOWER on IntegriCloud