2014-02-08 01:31:11 +08:00
|
|
|
// Setup:
|
|
|
|
// RUN: rm -rf %t
|
|
|
|
// RUN: mkdir -p %t/usr/include
|
|
|
|
// RUN: echo '// empty' > %t/usr/include/sys_header.h
|
2018-01-08 23:05:01 +08:00
|
|
|
// RUN: cat %s > %t.h
|
2014-02-08 01:31:11 +08:00
|
|
|
//
|
|
|
|
// Precompile
|
2014-10-04 06:18:49 +08:00
|
|
|
// RUN: %clang_cc1 -isystem %t/usr/include -x objective-c-header -emit-pch -o %t.pch %t.h
|
2014-02-06 06:21:15 +08:00
|
|
|
|
|
|
|
// Verify successfully
|
2014-10-04 06:18:49 +08:00
|
|
|
// RUN: %clang_cc1 -isystem %t/usr/include -verify-pch %t.pch
|
2014-02-06 06:21:15 +08:00
|
|
|
|
|
|
|
// Incompatible lang options ignored
|
2014-10-04 06:18:49 +08:00
|
|
|
// RUN: %clang_cc1 -isystem %t/usr/include -x objective-c -fno-builtin -verify-pch %t.pch
|
2014-02-06 06:21:15 +08:00
|
|
|
|
|
|
|
// Stale dependency
|
|
|
|
// RUN: echo ' ' >> %t.h
|
2014-10-04 06:18:49 +08:00
|
|
|
// RUN: not %clang_cc1 -isystem %t/usr/include -verify-pch %t.pch 2> %t.log.2
|
2014-02-06 06:21:15 +08:00
|
|
|
// 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
|
2014-02-08 01:31:11 +08:00
|
|
|
|
|
|
|
// Stale dependency in system header
|
2014-10-04 06:18:49 +08:00
|
|
|
// RUN: %clang_cc1 -isystem %t/usr/include -x objective-c-header -emit-pch -o %t.pch %t.h
|
|
|
|
// RUN: %clang_cc1 -isystem %t/usr/include -verify-pch %t.pch
|
2014-02-08 01:31:11 +08:00
|
|
|
// RUN: echo ' ' >> %t/usr/include/sys_header.h
|
2014-10-04 06:18:49 +08:00
|
|
|
// RUN: not %clang_cc1 -isystem %t/usr/include -verify-pch %t.pch 2> %t.log.3
|
2014-02-08 01:31:11 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-STALE-SYS-H %s < %t.log.3
|
2014-02-08 03:39:50 +08:00
|
|
|
// CHECK-STALE-SYS-H: file '{{.*}}sys_header.h' has been modified since the precompiled header '{{.*}}.pch' was built
|
2014-02-08 01:31:11 +08:00
|
|
|
|
|
|
|
#include <sys_header.h>
|