1 // Test that compiling using a PCH doesn't leak file descriptors.
2 // https://bugs.chromium.org/p/chromium/issues/detail?id=924225
4 // This test requires bash loops and ulimit.
6 // UNSUPPORTED: target={{.*win32.*}}
8 // Set up source files. lib/lib.h includes lots of lib*.h files in that dir.
9 // client.c includes lib/lib.h, and also the individual files directly.
15 // RUN: for i in {1..300}; do touch lib/lib$i.h; done
16 // RUN: for i in {1..300}; do echo "#include \"lib$i.h\"" >> lib/lib.h; done
17 // RUN: echo "#include \"lib/lib.h\"" > client.c
18 // RUN: for i in {1..300}; do echo "#include \"lib/lib$i.h\"" >> client.c; done
20 // We want to verify that we don't hold all the files open at the same time.
21 // This is important e.g. on mac, which has a low default FD limit.
25 // RUN: %clang_cc1 -fsyntax-only -Ilib/ client.c
28 // RUN: %clang_cc1 -emit-pch -o pch -Ilib/ client.c
29 // RUN: %clang_cc1 -include-pch pch -Ilib/ client.c -fsyntax-only