1// RUN: rm -rf %t/ModuleCache 2// RUN: mkdir -p %t/Inputs/usr/include 3// RUN: touch %t/Inputs/usr/include/foo.h 4// RUN: echo 'module Foo [system] { header "foo.h" }' > %t/Inputs/usr/include/module.map 5 6//// 7// Build a module using a system header 8// 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 9// RUN: cp %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved 10 11//// 12// Modify the system header, and confirm that we don't notice without -fmodules-validate-system-headers. 13// The pcm file in the cache should fail to validate. 14// RUN: echo ' ' >> %t/Inputs/usr/include/foo.h 15// 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 16// RUN: diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved 17 18//// 19// Now make sure we rebuild the module when -fmodules-validate-system-headers is set. 20// 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 21// RUN: not diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved 22 23// REQUIRES: shell 24 25@import Foo; 26