163fbaedaSAxel Naumann // Test reading of PCH without original input files.
263fbaedaSAxel Naumann 
363fbaedaSAxel Naumann // Generate the PCH, removing the original file:
463fbaedaSAxel Naumann // RUN: echo 'struct S{char c; int i; }; void foo() {}' > %t.h
563fbaedaSAxel Naumann // RUN: echo 'template <typename T> void tf() { T::foo(); }' >> %t.h
663fbaedaSAxel Naumann // RUN: %clang_cc1 -x c++ -emit-pch -o %t.h.pch %t.h
7*b75dd0c9SReid Kleckner // RUN: rm %t.h
863fbaedaSAxel Naumann 
963fbaedaSAxel Naumann // Check diagnostic with location in original source:
1072be390eSDouglas Gregor // RUN: not %clang_cc1 -include-pch %t.h.pch -emit-obj -o %t.o %s 2> %t.stderr
1172be390eSDouglas Gregor // RUN: grep 'could not find file' %t.stderr
1263fbaedaSAxel Naumann 
13*b75dd0c9SReid Kleckner // Oftentimes on Windows there are open handles, and deletion will fail.
14*b75dd0c9SReid Kleckner // REQUIRES: can-remove-opened-file
15*b75dd0c9SReid Kleckner 
qq(S *)1663fbaedaSAxel Naumann void qq(S*) {}
1763fbaedaSAxel Naumann 
1863fbaedaSAxel Naumann #ifdef REDECL
foo()1963fbaedaSAxel Naumann float foo() {return 0f;}
2063fbaedaSAxel Naumann #endif
2163fbaedaSAxel Naumann 
2263fbaedaSAxel Naumann #ifdef INSTANTIATION
f()2363fbaedaSAxel Naumann void f() {
2463fbaedaSAxel Naumann   tf<int>();
2563fbaedaSAxel Naumann }
2663fbaedaSAxel Naumann #endif
27