From 499512d6f275dcdee59d87921c5dbad542d2b97a Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Fri, 7 Feb 2014 17:31:11 +0000 Subject: 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 --- test/PCH/verify_pch.m | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'test/PCH') 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 -- cgit v1.2.3