1 // Test checking that we're hashing a system version file in the
4 // First, build a system root.
6 // RUN: mkdir -p %t/usr/include
7 // RUN: cp %S/Inputs/Modified/A.h %t/usr/include
8 // RUN: cp %S/Inputs/Modified/B.h %t/usr/include
9 // RUN: cp %S/Inputs/Modified/module.map %t/usr/include
11 // Run once with no system version file. We should end up with one module.
12 // RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -isysroot %t -I %t/usr/include %s -verify
13 // RUN: ls -R %t | grep -c "ModA.*pcm" | grep 1
15 // Add a system version file and run again. We should now have two
17 // RUN: mkdir -p %t/System/Library/CoreServices
18 // RUN: echo "hello" > %t/System/Library/CoreServices/SystemVersion.plist
19 // RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -isysroot %t -I %t/usr/include %s -verify
20 // RUN: ls -R %t | grep -c "ModA.*pcm" | grep 2
22 // Change the system version file and run again. We should now have three
24 // RUN: mkdir -p %t/System/Library/CoreServices
25 // RUN: echo "modules" > %t/System/Library/CoreServices/SystemVersion.plist
26 // RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -isysroot %t -I %t/usr/include %s -verify
27 // RUN: ls -R %t | grep -c "ModA.*pcm" | grep 3
29 // expected-no-diagnostics