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
|
2014-02-06 06:21:15 +08:00
|
|
|
// RUN: cp %s %t.h
|
2014-02-08 01:31:11 +08:00
|
|
|
//
|
|
|
|
// Precompile
|
2014-02-08 01:56:29 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t -x objective-c-header -emit-pch -o %t.pch %t.h
|
2014-02-06 06:21:15 +08:00
|
|
|
|
|
|
|
// Verify successfully
|
2014-02-08 01:56:29 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t -verify-pch %t.pch
|
2014-02-06 06:21:15 +08:00
|
|
|
|
|
|
|
// Incompatible lang options ignored
|
2014-02-08 01:56:29 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t -x objective-c -fno-builtin -verify-pch %t.pch
|
2014-02-06 06:21:15 +08:00
|
|
|
|
|
|
|
// Stale dependency
|
|
|
|
// RUN: echo ' ' >> %t.h
|
2014-02-08 01:56:29 +08:00
|
|
|
// RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t -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-02-08 01:56:29 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t -x objective-c-header -emit-pch -o %t.pch %t.h
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t -verify-pch %t.pch
|
2014-02-08 01:31:11 +08:00
|
|
|
// RUN: echo ' ' >> %t/usr/include/sys_header.h
|
2014-02-08 01:56:29 +08:00
|
|
|
// RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t -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>
|