2013-04-12 08:18:53 +08:00
|
|
|
// Test checking that we're hashing a system version file in the
|
|
|
|
// module hash.
|
|
|
|
|
|
|
|
// 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.
|
2015-06-16 08:08:24 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -isysroot %t -I %t/usr/include %s -verify
|
2014-04-15 02:00:01 +08:00
|
|
|
// RUN: ls -R %t | grep -c "ModA.*pcm" | grep 1
|
2013-04-12 08:18:53 +08:00
|
|
|
|
|
|
|
// 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
|
2015-06-16 08:08:24 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -isysroot %t -I %t/usr/include %s -verify
|
2014-04-15 02:00:01 +08:00
|
|
|
// RUN: ls -R %t | grep -c "ModA.*pcm" | grep 2
|
2013-04-12 08:18:53 +08:00
|
|
|
|
|
|
|
// 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
|
2015-06-16 08:08:24 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -isysroot %t -I %t/usr/include %s -verify
|
2014-04-15 02:00:01 +08:00
|
|
|
// RUN: ls -R %t | grep -c "ModA.*pcm" | grep 3
|
2013-04-12 08:18:53 +08:00
|
|
|
|
|
|
|
// expected-no-diagnostics
|
|
|
|
@import ModA;
|
|
|
|
|