
We used to have a flag to enable module maps, and two more flags to enable implicit module maps. This is all redundant; we don't need any flag for enabling module maps in the abstract, and we don't usually have -fno- flags for -cc1. We now have just a single flag, -fimplicit-module-maps, that enables implicitly searching the file system for module map files and loading them. The driver interface is unchanged for now. We should probably rename -fmodule-maps to -fimplicit-module-maps at some point. llvm-svn: 239789
32 lines
1.3 KiB
Matlab
32 lines
1.3 KiB
Matlab
// 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.
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -isysroot %t -I %t/usr/include %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 -fimplicit-module-maps -isysroot %t -I %t/usr/include %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 -fimplicit-module-maps -isysroot %t -I %t/usr/include %s -verify
|
|
// RUN: ls -R %t | grep -c "ModA.*pcm" | grep 3
|
|
|
|
// expected-no-diagnostics
|
|
@import ModA;
|
|
|