1 | // Setup: |
2 | // RUN: rm -rf %t |
3 | // RUN: mkdir -p %t/usr/include |
4 | // RUN: echo '// empty' > %t/usr/include/sys_header.h |
5 | // RUN: cat %s > %t.h |
6 | // |
7 | // Precompile |
8 | // RUN: %clang_cc1 -isystem %t/usr/include -x objective-c-header -emit-pch -o %t.pch %t.h |
9 | |
10 | // Verify successfully |
11 | // RUN: %clang_cc1 -isystem %t/usr/include -verify-pch %t.pch |
12 | |
13 | // Incompatible lang options ignored |
14 | // RUN: %clang_cc1 -isystem %t/usr/include -x objective-c -fno-builtin -verify-pch %t.pch |
15 | |
16 | // Stale dependency |
17 | // RUN: echo ' ' >> %t.h |
18 | // RUN: not %clang_cc1 -isystem %t/usr/include -verify-pch %t.pch 2> %t.log.2 |
19 | // RUN: FileCheck -check-prefix=CHECK-STALE-DEP %s < %t.log.2 |
20 | // CHECK-STALE-DEP: file '{{.*}}.h' has been modified since the precompiled header '{{.*}}.pch' was built |
21 | |
22 | // Stale dependency in system header |
23 | // RUN: %clang_cc1 -isystem %t/usr/include -x objective-c-header -emit-pch -o %t.pch %t.h |
24 | // RUN: %clang_cc1 -isystem %t/usr/include -verify-pch %t.pch |
25 | // RUN: echo ' ' >> %t/usr/include/sys_header.h |
26 | // RUN: not %clang_cc1 -isystem %t/usr/include -verify-pch %t.pch 2> %t.log.3 |
27 | // RUN: FileCheck -check-prefix=CHECK-STALE-SYS-H %s < %t.log.3 |
28 | // CHECK-STALE-SYS-H: file '{{.*}}sys_header.h' has been modified since the precompiled header '{{.*}}.pch' was built |
29 | |
30 | #include <sys_header.h> |
31 | |