summaryrefslogtreecommitdiff
path: root/test/PCH
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-02-07 17:31:11 +0000
committerBen Langmuir <blangmuir@apple.com>2014-02-07 17:31:11 +0000
commit499512d6f275dcdee59d87921c5dbad542d2b97a (patch)
treebc2fec58badffd38183289e954bea6fc58d5d52f /test/PCH
parentd95b96f39f5a6abc9fd7b328be858676e70f7cd2 (diff)
downloadclang-499512d6f275dcdee59d87921c5dbad542d2b97a.tar.gz
clang-499512d6f275dcdee59d87921c5dbad542d2b97a.tar.bz2
clang-499512d6f275dcdee59d87921c5dbad542d2b97a.tar.xz
Stat system dependencies when using -verify-pch
We don't stat the system headers to check for stalenes during regular PCH loading for performance reasons. When explicitly saying -verify-pch, we want to check all the dependencies - user or system. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/PCH')
-rw-r--r--test/PCH/verify_pch.m25
1 files changed, 20 insertions, 5 deletions
diff --git a/test/PCH/verify_pch.m b/test/PCH/verify_pch.m
index 9870231d7c..9c7bab8f0b 100644
--- a/test/PCH/verify_pch.m
+++ b/test/PCH/verify_pch.m
@@ -1,15 +1,30 @@
-// Precompile
+// Setup:
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/usr/include
+// RUN: echo '// empty' > %t/usr/include/sys_header.h
// RUN: cp %s %t.h
-// RUN: %clang_cc1 -x objective-c-header -emit-pch -o %t.pch %t.h
+//
+// Precompile
+// RUN: %clang_cc1 -isysroot %t -x objective-c-header -emit-pch -o %t.pch %t.h
// Verify successfully
-// RUN: %clang_cc1 -x objective-c -verify-pch %t.pch
+// RUN: %clang_cc1 -isysroot %t -verify-pch %t.pch
// Incompatible lang options ignored
-// RUN: %clang_cc1 -x objective-c -fno-builtin -verify-pch %t.pch
+// RUN: %clang_cc1 -isysroot %t -x objective-c -fno-builtin -verify-pch %t.pch
// Stale dependency
// RUN: echo ' ' >> %t.h
-// RUN: not %clang_cc1 -x objective-c -verify-pch %t.pch 2> %t.log.2
+// RUN: not %clang_cc1 -isysroot %t -verify-pch %t.pch 2> %t.log.2
// RUN: FileCheck -check-prefix=CHECK-STALE-DEP %s < %t.log.2
// CHECK-STALE-DEP: file '{{.*}}.h' has been modified since the precompiled header '{{.*}}.pch' was built
+
+// Stale dependency in system header
+// RUN: %clang_cc1 -isysroot %t -x objective-c-header -emit-pch -o %t.pch %t.h
+// RUN: %clang_cc1 -isysroot %t -verify-pch %t.pch
+// RUN: echo ' ' >> %t/usr/include/sys_header.h
+// RUN: not %clang_cc1 -isysroot %t -verify-pch %t.pch 2> %t.log.3
+// RUN: FileCheck -check-prefix=CHECK-STALE-SYS-H %s < %t.log.3
+// CHECK-STALE-SYS-H: file '{{.*}}/usr/include/sys_header.h' has been modified since the precompiled header '{{.*}}.pch' was built
+
+#include <sys_header.h>