brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 7599d4e Raw
42 lines · plain
1// RUN: rm -rf %t/ModuleCache2// RUN: mkdir -p %t/Inputs/usr/include3// RUN: touch %t/Inputs/usr/include/foo.h4// RUN: echo 'module Foo [system] { header "foo.h" }' > %t/Inputs/usr/include/module.modulemap5 6////7// Build a module using a system header8// RUN: %clang_cc1 -isystem %t/Inputs/usr/include -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s9// RUN: cp %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved10 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.h15// RUN: %clang_cc1 -isystem %t/Inputs/usr/include -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s16// RUN: diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved17 18////19// Now make sure we rebuild the module when -fmodules-validate-system-headers is set.20// RUN: %clang_cc1 -isystem %t/Inputs/usr/include -fmodules -fimplicit-module-maps -fmodules-validate-system-headers -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s21// RUN: not diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved22 23 24////25// This should override -fmodules-validate-once-per-build-session26// RUN: cp %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved27// RUN: %clang_cc1 -isystem %t/Inputs/usr/include -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session28// RUN: diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved29 30// Modify the system header...31// RUN: echo ' ' >> %t/Inputs/usr/include/foo.h32 33// Don't recompile due to -fmodules-validate-once-per-build-session34// RUN: %clang_cc1 -isystem %t/Inputs/usr/include -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModuleCache -fdisable-module-hash -x objective-c-header -fsyntax-only %s -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session35// RUN: diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved36 37// Now add -fmodules-validate-system-headers and rebuild. No recompilation due to -fmodules-validate-once-per-build-session38// RUN: %clang_cc1 -isystem %t/Inputs/usr/include -fmodules -fimplicit-module-maps -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-session39// RUN: diff %t/ModuleCache/Foo.pcm %t/Foo.pcm.saved40 41@import Foo;42