diff options
| author | Douglas Gregor <dgregor@apple.com> | 2013-04-12 00:18:53 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2013-04-12 00:18:53 +0000 |
| commit | c9be4734d68954b226aab349a08cdd89053f095a (patch) | |
| tree | d6a28e106ada2f0d94b8ba7f37c27dbf4b6a8cf8 /clang/test/Modules | |
| parent | ecf132057979bd5e0d005d042ffcf6fcffbcff22 (diff) | |
| download | bcm5719-llvm-c9be4734d68954b226aab349a08cdd89053f095a.tar.gz bcm5719-llvm-c9be4734d68954b226aab349a08cdd89053f095a.zip | |
<rdar://problem/13615607> Include SDK version information in the module hash.
This is a Darwin-SDK-specific hash criteria used to identify a
particular SDK without having to hash the contents of all of its
headers. If other platforms have such versioned files, we should add
those checks here.
llvm-svn: 179346
Diffstat (limited to 'clang/test/Modules')
| -rw-r--r-- | clang/test/Modules/system_version.m | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/Modules/system_version.m b/clang/test/Modules/system_version.m new file mode 100644 index 00000000000..2beddf4e1d3 --- /dev/null +++ b/clang/test/Modules/system_version.m @@ -0,0 +1,32 @@ +// Test checking that we're hashing a system version file in the +// module hash. +// REQUIRES: shell + +// First, build a system root. +// RUN: rm -rf %t +// RUN: mkdir -p %t/usr/include +// RUN: cp %S/Inputs/Modified/A.h %t/usr/include +// RUN: cp %S/Inputs/Modified/B.h %t/usr/include +// RUN: cp %S/Inputs/Modified/module.map %t/usr/include + +// Run once with no system version file. We should end up with one module. +// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -isysroot %t %s -verify +// RUN: ls -R %t | grep -c ModA.pcm| grep 1 + +// Add a system version file and run again. We should now have two +// module variants. +// RUN: mkdir -p %t/System/Library/CoreServices +// RUN: echo "hello" > %t/System/Library/CoreServices/SystemVersion.plist +// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -isysroot %t %s -verify +// RUN: ls -R %t | grep -c ModA.pcm| grep 2 + +// Change the system version file and run again. We should now have three +// module variants. +// RUN: mkdir -p %t/System/Library/CoreServices +// RUN: echo "modules" > %t/System/Library/CoreServices/SystemVersion.plist +// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -isysroot %t %s -verify +// RUN: ls -R %t | grep -c ModA.pcm| grep 3 + +// expected-no-diagnostics +@import ModA; + |

