pch-dir.c revision 674b227bc50852b96567428941bc711949529f92
1// RUN: mkdir -p %t.h.gch
2// RUN: %clang -x c-header %S/pch-dir.h -o %t.h.gch/c.gch
3// RUN: %clang -x c++-header %S/pch-dir.h -o %t.h.gch/cpp.gch
4// RUN: %clang -include %t.h -fsyntax-only %s -Xclang -print-stats 2> %t.clog
5// RUN: FileCheck -check-prefix=C %s < %t.clog
6// RUN: %clang -x c++ -include %t.h -fsyntax-only %s -Xclang -print-stats 2> %t.cpplog
7// RUN: FileCheck -check-prefix=CPP %s < %t.cpplog
8// RUN: not %clang -x c++ -std=c++11 -include %t.h -fsyntax-only %s 2> %t.cpp11log
9// RUN: FileCheck -check-prefix=CPP11 %s < %t.cpp11log
10
11
12int get() {
13#ifdef __cplusplus
14  // CHECK-CPP: .h.gch{{[/\\]}}cpp.gch
15  return i;
16#else
17  // CHECK-C: .h.gch{{[/\\]}}c.gch
18  return j;
19#endif
20}
21
22// CHECK-CPP11: no suitable precompiled header file found in directory
23