diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/PCH/remap-file-from-pch.cpp | 10 | ||||
-rw-r--r-- | clang/test/PCH/remap-file-from-pch.cpp.h | 2 | ||||
-rw-r--r-- | clang/test/PCH/remap-file-from-pch.cpp.remap.h | 4 |
3 files changed, 16 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' diff --git a/clang/test/PCH/remap-file-from-pch.cpp.h b/clang/test/PCH/remap-file-from-pch.cpp.h new file mode 100644 index 00000000000..0edf6aa7cd3 --- /dev/null +++ b/clang/test/PCH/remap-file-from-pch.cpp.h @@ -0,0 +1,2 @@ + +#define STR "nexus" diff --git a/clang/test/PCH/remap-file-from-pch.cpp.remap.h b/clang/test/PCH/remap-file-from-pch.cpp.remap.h new file mode 100644 index 00000000000..e8e8ab7e4bd --- /dev/null +++ b/clang/test/PCH/remap-file-from-pch.cpp.remap.h @@ -0,0 +1,4 @@ + +#define STR "nexus" + +int zool; |