blob: 85b3263f7256f04af981adcfa38876112820e16a [file] [log] [blame]
Douglas Gregor31230e62013-04-12 00:18:53 +00001// Test checking that we're hashing a system version file in the
2// module hash.
3// REQUIRES: shell
4
5// First, build a system root.
6// RUN: rm -rf %t
7// RUN: mkdir -p %t/usr/include
8// RUN: cp %S/Inputs/Modified/A.h %t/usr/include
9// RUN: cp %S/Inputs/Modified/B.h %t/usr/include
10// RUN: cp %S/Inputs/Modified/module.map %t/usr/include
11
12// Run once with no system version file. We should end up with one module.
Douglas Gregord7fed8e2013-04-12 00:23:25 +000013// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -isysroot %t -I %t/usr/include %s -verify
Douglas Gregor31230e62013-04-12 00:18:53 +000014// RUN: ls -R %t | grep -c ModA.pcm| grep 1
15
16// Add a system version file and run again. We should now have two
17// module variants.
18// RUN: mkdir -p %t/System/Library/CoreServices
19// RUN: echo "hello" > %t/System/Library/CoreServices/SystemVersion.plist
Douglas Gregord7fed8e2013-04-12 00:23:25 +000020// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -isysroot %t -I %t/usr/include %s -verify
Douglas Gregor31230e62013-04-12 00:18:53 +000021// RUN: ls -R %t | grep -c ModA.pcm| grep 2
22
23// Change the system version file and run again. We should now have three
24// module variants.
25// RUN: mkdir -p %t/System/Library/CoreServices
26// RUN: echo "modules" > %t/System/Library/CoreServices/SystemVersion.plist
Douglas Gregord7fed8e2013-04-12 00:23:25 +000027// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -isysroot %t -I %t/usr/include %s -verify
Douglas Gregor31230e62013-04-12 00:18:53 +000028// RUN: ls -R %t | grep -c ModA.pcm| grep 3
29
30// expected-no-diagnostics
31@import ModA;
32