blob: 9fb2bd2a637a4bd500f720eb1c38004498be1b3c [file] [log] [blame]
// RUN: rm -rf %t/ModuleCache
// RUN: mkdir -p %t/Inputs/usr/include
// RUN: touch %t/Inputs/usr/include/foo.h
// RUN: echo 'module Foo [system] { header "foo.h" }' > %t/Inputs/usr/include/module.map
////
// Build a module using a system header
// 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
// RUN: cp %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved
////
// Modify the system header, and confirm that we don't notice without -fmodules-validate-system-headers.
// The pcm file in the cache should fail to validate.
// RUN: echo ' ' >> %t/Inputs/usr/include/foo.h
// 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
// RUN: diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved
////
// Now make sure we rebuild the module when -fmodules-validate-system-headers is set.
// 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
// REQUIRES: shell
@import Foo;