diff options
| -rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 2 | ||||
| -rw-r--r-- | clang/test/Modules/validate-system-headers.m | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index ff0b1dd6294..67c917bba49 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -2117,7 +2117,7 @@ ASTReader::ReadControlBlock(ModuleFile &F, unsigned NumUserInputs = Record[1]; if (!DisableValidation && - (!HSOpts.ModulesValidateOncePerBuildSession || + (ValidateSystemInputs || !HSOpts.ModulesValidateOncePerBuildSession || F.InputFilesValidationTimestamp <= HSOpts.BuildSessionTimestamp)) { bool Complain = (ClientLoadCapabilities & ARR_OutOfDate) == 0; diff --git a/clang/test/Modules/validate-system-headers.m b/clang/test/Modules/validate-system-headers.m index 9fb2bd2a637..48ea64c5a93 100644 --- a/clang/test/Modules/validate-system-headers.m +++ b/clang/test/Modules/validate-system-headers.m @@ -20,6 +20,24 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t/Inputs -fmodules -fmodules-validate-system-headers -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s // RUN: not diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved + +//// +// This should override -fmodules-validate-once-per-build-session +// RUN: cp %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t/Inputs -fmodules -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session +// RUN: diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved + +// Modify the system header... +// RUN: echo ' ' >> %t/Inputs/usr/include/foo.h + +// Don't recompile due to -fmodules-validate-once-per-build-session +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t/Inputs -fmodules -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session +// RUN: diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved + +// Now add -fmodules-validate-system-headers and rebuild +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -isysroot %t/Inputs -fmodules -fmodules-validate-system-headers -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session +// RUN: not diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved + // REQUIRES: shell @import Foo; |

