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