Driver: Default to using PTH for C++ precompiled header support, PCH for C++
isn't implemented yet.
- <rdar://problem/7297571> Clang should use pretokenized headers for C++ PCH
files
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84197 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Driver/cxx-pth.cpp b/test/Driver/cxx-pth.cpp
new file mode 100644
index 0000000..a06a257
--- /dev/null
+++ b/test/Driver/cxx-pth.cpp
@@ -0,0 +1,12 @@
+// Test forced PTH for CXX support.
+
+// RUN: clang -x c++-header %s -### 2> %t.log &&
+// RUN: FileCheck -check-prefix EMIT -input-file %t.log %s &&
+
+// EMIT: "{{.*}}/clang-cc{{.*}}" {{.*}} "-emit-pth" "{{.*}}.cpp.gch" "-x" "c++-header" "{{.*}}.cpp"
+
+// RUN: touch %t.h.gch &&
+// RUN: clang -E -include %t.h %s -### 2> %t.log &&
+// RUN: FileCheck -check-prefix USE -input-file %t.log %s
+
+// USE: "{{.*}}/clang-cc{{.*}}" {{.*}}"-include-pth" "{{.*}}.h.gch" {{.*}}"-x" "c++" "{{.*}}.cpp"