[clang-tools-extra] a171d24 - [clang][modules] Deprecate module.map in favor of module.modulemap (#75142)

via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 14 14:04:01 PST 2023


Author: Michael Spencer
Date: 2023-12-14T14:03:57-08:00
New Revision: a171d248ca34b8b6f8de11d42a83ad981285963a

URL: https://github.com/llvm/llvm-project/commit/a171d248ca34b8b6f8de11d42a83ad981285963a
DIFF: https://github.com/llvm/llvm-project/commit/a171d248ca34b8b6f8de11d42a83ad981285963a.diff

LOG: [clang][modules] Deprecate module.map in favor of module.modulemap (#75142)

This patch deprecates `module.map` in favor of `module.modulemap`, which
has been the preferred form since 2014. The eventual goal is to remove
support for `module.map` to reduce the number of stats Clang needs to do
while searching for module map files.

This patch touches a lot of files, but the majority of them are just
renaming tests or references to the file in comments or documentation.

The relevant files are:
* lib/Lex/HeaderSearch.cpp
* include/clang/Basic/DiagnosticGroups.td
* include/clang/Basic/DiagnosticLexKinds.td

Added: 
    clang-tools-extra/include-cleaner/test/Inputs/modules/module.modulemap
    clang-tools-extra/test/pp-trace/Inputs/module.modulemap
    clang/test/ARCMT/Inputs/module.modulemap
    clang/test/Index/Inputs/Frameworks/module.modulemap
    clang/test/Index/Inputs/Headers/module.modulemap
    clang/test/Index/Inputs/Headers/nested/module.modulemap
    clang/test/Index/Inputs/module.modulemap
    clang/test/Modules/Inputs/Conflicts/module.modulemap
    clang/test/Modules/Inputs/DependsOnModule.framework/Modules/module.modulemap
    clang/test/Modules/Inputs/DependsOnModule.framework/Modules/module.private.modulemap
    clang/test/Modules/Inputs/GNUAsm/NeedsGNUInlineAsm.framework/Modules/module.modulemap
    clang/test/Modules/Inputs/Modified/module.modulemap
    clang/test/Modules/Inputs/ModuleDiags/module.modulemap
    clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/a.h
    clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/module.map
    clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/module_private.map
    clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/private.h
    clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/Headers/a.h
    clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/PrivateHeaders/private.h
    clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/module.map
    clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/module_private.map
    clang/test/Modules/Inputs/NoUmbrella.framework/Modules/module.modulemap
    clang/test/Modules/Inputs/NoUmbrella.framework/Modules/module.private.modulemap
    clang/test/Modules/Inputs/StdDef/module.modulemap
    clang/test/Modules/Inputs/System/usr/include/module.modulemap
    clang/test/Modules/Inputs/UseAfterFree/module.modulemap
    clang/test/Modules/Inputs/UseAfterFree/module.private.modulemap
    clang/test/Modules/Inputs/crash-recovery/usr/include/module.modulemap
    clang/test/Modules/Inputs/declare-use/module.modulemap
    clang/test/Modules/Inputs/elsewhere/module.modulemap
    clang/test/Modules/Inputs/exclude-header/module.modulemap
    clang/test/Modules/Inputs/implicit-private-without-public/DeprecatedModuleMapLocation.framework/module.private.modulemap
    clang/test/Modules/Inputs/include-relative/module.modulemap
    clang/test/Modules/Inputs/lookup-assert-protocol/module.modulemap
    clang/test/Modules/Inputs/lookup-assert/module.modulemap
    clang/test/Modules/Inputs/macro-undef-through-pch/module.modulemap
    clang/test/Modules/Inputs/malformed/module.modulemap
    clang/test/Modules/Inputs/module.modulemap
    clang/test/Modules/Inputs/ms-enums/module.modulemap
    clang/test/Modules/Inputs/normal-module-map/Umbrella/module.modulemap
    clang/test/Modules/Inputs/normal-module-map/Umbrella2/module.modulemap
    clang/test/Modules/Inputs/normal-module-map/module.modulemap
    clang/test/Modules/Inputs/normal-module-map/nested/module.modulemap
    clang/test/Modules/Inputs/objc-category-2/module.modulemap
    clang/test/Modules/Inputs/objc-category-3/module.modulemap
    clang/test/Modules/Inputs/objc-category/module.modulemap
    clang/test/Modules/Inputs/objc-hidden/System/module.modulemap
    clang/test/Modules/Inputs/odr/module.modulemap
    clang/test/Modules/Inputs/oldname/module.modulemap
    clang/test/Modules/Inputs/pr19692/module.modulemap
    clang/test/Modules/Inputs/private/module.modulemap
    clang/test/Modules/Inputs/private1/module.modulemap
    clang/test/Modules/Inputs/private2/module.modulemap
    clang/test/Modules/Inputs/redecls/module.modulemap
    clang/test/Modules/Inputs/self-import-header/af.framework/Modules/module.modulemap
    clang/test/Modules/Inputs/self-import-header/depend_builtin/module.modulemap
    clang/test/Modules/Inputs/string_names/module.modulemap
    clang/test/Modules/Inputs/subdir/module.modulemap
    clang/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.modulemap
    clang/test/Modules/Inputs/submodules/module.modulemap
    clang/test/Modules/Inputs/system-out-of-date/module.modulemap
    clang/test/Modules/Inputs/template-specialization-visibility/module.modulemap
    clang/test/Modules/Inputs/thread-safety/module.modulemap
    clang/test/Modules/Inputs/undefined-type-fixit/module.modulemap
    clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.modulemap
    clang/test/Modules/Inputs/update-after-load/module.modulemap
    clang/test/Modules/Inputs/wildcard-submodule-exports/module.modulemap
    clang/test/SemaObjC/Inputs/module.modulemap

Modified: 
    clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
    clang-tools-extra/docs/modularize.rst
    clang-tools-extra/modularize/Modularize.cpp
    clang-tools-extra/modularize/ModularizeUtilities.cpp
    clang-tools-extra/modularize/ModularizeUtilities.h
    clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap
    clang-tools-extra/test/modularize/Inputs/CoverageNoProblems/module.modulemap
    clang-tools-extra/test/modularize/Inputs/CoverageProblems/module.modulemap
    clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap
    clang/include/clang-c/BuildSystem.h
    clang/include/clang/Basic/DiagnosticGroups.td
    clang/include/clang/Basic/DiagnosticLexKinds.td
    clang/lib/Lex/HeaderSearch.cpp
    clang/test/Index/Inputs/vfsoverlay.yaml
    clang/test/Modules/concept_differ.cpp
    clang/test/Modules/config_macros.m
    clang/test/Modules/crash-vfs-ivfsoverlay.m
    clang/test/Modules/crash-vfs-path-symlink-component.m
    clang/test/Modules/crash-vfs-path-traversal.m
    clang/test/Modules/crash-vfs-relative-incdir.m
    clang/test/Modules/crash-vfs-relative-overlay.m
    clang/test/Modules/crash-vfs-run-reproducer.m
    clang/test/Modules/declare-use-compatible.cpp
    clang/test/Modules/dependency-gen-pch.m
    clang/test/Modules/dependency-gen.m
    clang/test/Modules/diag-flags.cpp
    clang/test/Modules/diag-pragma.c
    clang/test/Modules/diag-pragma.cpp
    clang/test/Modules/diamond-pch.c
    clang/test/Modules/diamond.c
    clang/test/Modules/extern_c_bad.cpp
    clang/test/Modules/fmodules-validate-once-per-build-session.c
    clang/test/Modules/fsystem-module.m
    clang/test/Modules/irgen.c
    clang/test/Modules/linkage-merge.m
    clang/test/Modules/load_failure.c
    clang/test/Modules/lookup.cpp
    clang/test/Modules/lookup.m
    clang/test/Modules/merge-concepts.cppm
    clang/test/Modules/missing-header.m
    clang/test/Modules/modify-module.m
    clang/test/Modules/module-file-home-is-cwd.m
    clang/test/Modules/module-private.cpp
    clang/test/Modules/module_file_info.m
    clang/test/Modules/modulemap-locations.m
    clang/test/Modules/no-stale-modtime.m
    clang/test/Modules/objc-at-keyword.m
    clang/test/Modules/objc-categories.m
    clang/test/Modules/objc-type-param.m
    clang/test/Modules/objc_redef.m
    clang/test/Modules/odr_hash-blocks.cpp
    clang/test/Modules/odr_hash-gnu.cpp
    clang/test/Modules/odr_hash-vector.cpp
    clang/test/Modules/odr_hash.cl
    clang/test/Modules/odr_hash.cpp
    clang/test/Modules/odr_hash.mm
    clang/test/Modules/pragma-pack.cpp
    clang/test/Modules/recursive.c
    clang/test/Modules/redecl-namespaces.mm
    clang/test/Modules/redeclarations.m
    clang/test/Modules/relative-submodule-topheader.m
    clang/test/Modules/requires-coroutines.mm
    clang/test/Modules/requires-gnuinlineasm.m
    clang/test/Modules/requires.m
    clang/test/Modules/requires.mm
    clang/test/Modules/target-platform-features.m
    clang/test/Modules/timestamps.c
    clang/test/Modules/validate-system-headers.m
    clang/test/PCH/modified-module-dependency.m
    clang/test/Preprocessor/pragma_module.c
    clang/test/VFS/Inputs/vfsoverlay.yaml
    clang/test/VFS/Inputs/vfsoverlay2.yaml
    clang/test/VFS/test_nonmodular.c
    clang/unittests/Tooling/ToolingTest.cpp

Removed: 
    clang-tools-extra/include-cleaner/test/Inputs/modules/module.map
    clang-tools-extra/test/pp-trace/Inputs/module.map
    clang/test/ARCMT/Inputs/module.map
    clang/test/Index/Inputs/Frameworks/module.map
    clang/test/Index/Inputs/Headers/module.map
    clang/test/Index/Inputs/Headers/nested/module.map
    clang/test/Index/Inputs/module.map
    clang/test/Modules/Inputs/Conflicts/module.map
    clang/test/Modules/Inputs/DependsOnModule.framework/module.map
    clang/test/Modules/Inputs/DependsOnModule.framework/module_private.map
    clang/test/Modules/Inputs/GNUAsm/NeedsGNUInlineAsm.framework/module.map
    clang/test/Modules/Inputs/Modified/module.map
    clang/test/Modules/Inputs/ModuleDiags/module.map
    clang/test/Modules/Inputs/NoUmbrella.framework/module.map
    clang/test/Modules/Inputs/NoUmbrella.framework/module_private.map
    clang/test/Modules/Inputs/StdDef/module.map
    clang/test/Modules/Inputs/System/usr/include/module.map
    clang/test/Modules/Inputs/UseAfterFree/module.map
    clang/test/Modules/Inputs/UseAfterFree/module_private.map
    clang/test/Modules/Inputs/crash-recovery/usr/include/module.map
    clang/test/Modules/Inputs/declare-use/module.map
    clang/test/Modules/Inputs/elsewhere/module.map
    clang/test/Modules/Inputs/exclude-header/module.map
    clang/test/Modules/Inputs/implicit-private-without-public/DeprecatedModuleMapLocation.framework/module_private.map
    clang/test/Modules/Inputs/include-relative/module.map
    clang/test/Modules/Inputs/lookup-assert-protocol/module.map
    clang/test/Modules/Inputs/lookup-assert/module.map
    clang/test/Modules/Inputs/macro-undef-through-pch/module.map
    clang/test/Modules/Inputs/malformed/module.map
    clang/test/Modules/Inputs/module.map
    clang/test/Modules/Inputs/ms-enums/module.map
    clang/test/Modules/Inputs/normal-module-map/Umbrella/module.map
    clang/test/Modules/Inputs/normal-module-map/Umbrella2/module.map
    clang/test/Modules/Inputs/normal-module-map/module.map
    clang/test/Modules/Inputs/normal-module-map/nested/module.map
    clang/test/Modules/Inputs/objc-category-2/module.map
    clang/test/Modules/Inputs/objc-category-3/module.map
    clang/test/Modules/Inputs/objc-category/module.map
    clang/test/Modules/Inputs/objc-hidden/System/module.map
    clang/test/Modules/Inputs/odr/module.map
    clang/test/Modules/Inputs/oldname/module.map
    clang/test/Modules/Inputs/pr19692/module.map
    clang/test/Modules/Inputs/private/module.map
    clang/test/Modules/Inputs/private1/module.map
    clang/test/Modules/Inputs/private2/module.map
    clang/test/Modules/Inputs/redecls/module.map
    clang/test/Modules/Inputs/self-import-header/af.framework/module.map
    clang/test/Modules/Inputs/self-import-header/depend_builtin/module.map
    clang/test/Modules/Inputs/string_names/module.map
    clang/test/Modules/Inputs/subdir/module.map
    clang/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map
    clang/test/Modules/Inputs/submodules/module.map
    clang/test/Modules/Inputs/system-out-of-date/module.map
    clang/test/Modules/Inputs/template-specialization-visibility/module.map
    clang/test/Modules/Inputs/thread-safety/module.map
    clang/test/Modules/Inputs/undefined-type-fixit/module.map
    clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.map
    clang/test/Modules/Inputs/update-after-load/module.map
    clang/test/Modules/Inputs/wildcard-submodule-exports/module.map
    clang/test/SemaObjC/Inputs/module.map


################################################################################
diff  --git a/clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp b/clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
index f12441061c1983..9cdc57ec01f327 100644
--- a/clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
+++ b/clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
@@ -1917,14 +1917,14 @@ TEST_F(SymbolCollectorTest, UndefOfModuleMacro) {
     #undef X
     )cpp";
   TU.AdditionalFiles["foo.h"] = "#define X 1";
-  TU.AdditionalFiles["module.map"] = R"cpp(
+  TU.AdditionalFiles["module.modulemap"] = R"cpp(
     module foo {
      header "foo.h"
      export *
    }
    )cpp";
   TU.ExtraArgs.push_back("-fmodules");
-  TU.ExtraArgs.push_back("-fmodule-map-file=" + testPath("module.map"));
+  TU.ExtraArgs.push_back("-fmodule-map-file=" + testPath("module.modulemap"));
   TU.OverlayRealFileSystemForModules = true;
 
   TU.build();

diff  --git a/clang-tools-extra/docs/modularize.rst b/clang-tools-extra/docs/modularize.rst
index 9dde467ec30847..64ca8c99d4e8ef 100644
--- a/clang-tools-extra/docs/modularize.rst
+++ b/clang-tools-extra/docs/modularize.rst
@@ -20,7 +20,7 @@ map.
 :program:`modularize` also has an assistant mode option for generating
 a module map file based on the provided header list. The generated file
 is a functional module map that can be used as a starting point for a
-module.map file.
+module.modulemap file.
 
 Getting Started
 ===============

diff  --git a/clang-tools-extra/include-cleaner/test/Inputs/modules/module.map b/clang-tools-extra/include-cleaner/test/Inputs/modules/module.modulemap
similarity index 100%
rename from clang-tools-extra/include-cleaner/test/Inputs/modules/module.map
rename to clang-tools-extra/include-cleaner/test/Inputs/modules/module.modulemap

diff  --git a/clang-tools-extra/modularize/Modularize.cpp b/clang-tools-extra/modularize/Modularize.cpp
index daa9c048279e03..f3e7dfc20b027d 100644
--- a/clang-tools-extra/modularize/Modularize.cpp
+++ b/clang-tools-extra/modularize/Modularize.cpp
@@ -51,20 +51,20 @@
 //          to the header list file directory.  Use -prefix to specify a
 //          
diff erent directory.
 //    -module-map-path=(module map)
-//          Skip the checks, and instead act as a module.map generation
+//          Skip the checks, and instead act as a module.modulemap generation
 //          assistant, generating a module map file based on the header list.
 //          An optional "-root-module=(rootName)" argument can specify a root
-//          module to be created in the generated module.map file.  Note that
-//          you will likely need to edit this file to suit the needs of your
-//          headers.
+//          module to be created in the generated module.modulemap file.  Note
+//          that you will likely need to edit this file to suit the needs of
+//          your headers.
 //    -problem-files-list=(problem files list file name)
 //          For use only with module map assistant.  Input list of files that
 //          have problems with respect to modules.  These will still be
 //          included in the generated module map, but will be marked as
 //          "excluded" headers.
 //    -root-module=(root module name)
-//          Specifies a root module to be created in the generated module.map
-//          file.
+//          Specifies a root module to be created in the generated
+//          module.modulemap file.
 //    -block-check-header-list-only
 //          Only warn if #include directives are inside extern or namespace
 //          blocks if the included header is in the header list.

diff  --git a/clang-tools-extra/modularize/ModularizeUtilities.cpp b/clang-tools-extra/modularize/ModularizeUtilities.cpp
index dfca3eefe47320..25de9c9dd05ac9 100644
--- a/clang-tools-extra/modularize/ModularizeUtilities.cpp
+++ b/clang-tools-extra/modularize/ModularizeUtilities.cpp
@@ -102,10 +102,10 @@ std::error_code ModularizeUtilities::loadAllHeaderListsAndDependencies() {
 
 // Do coverage checks.
 // For each loaded module map, do header coverage check.
-// Starting from the directory of the module.map file,
+// Starting from the directory of the module.modulemap file,
 // Find all header files, optionally looking only at files
 // covered by the include path options, and compare against
-// the headers referenced by the module.map file.
+// the headers referenced by the module.modulemap file.
 // Display warnings for unaccounted-for header files.
 // Returns 0 if there were no errors or warnings, 1 if there
 // were warnings, 2 if any other problem, such as a bad

diff  --git a/clang-tools-extra/modularize/ModularizeUtilities.h b/clang-tools-extra/modularize/ModularizeUtilities.h
index 6da15e42f1f1ea..64675022dad76e 100644
--- a/clang-tools-extra/modularize/ModularizeUtilities.h
+++ b/clang-tools-extra/modularize/ModularizeUtilities.h
@@ -89,10 +89,10 @@ class ModularizeUtilities {
 
   /// Do coverage checks.
   /// For each loaded module map, do header coverage check.
-  /// Starting from the directory of the module.map file,
+  /// Starting from the directory of the module.modulemap file,
   /// Find all header files, optionally looking only at files
   /// covered by the include path options, and compare against
-  /// the headers referenced by the module.map file.
+  /// the headers referenced by the module.modulemap file.
   /// Display warnings for unaccounted-for header files.
   /// \param IncludePaths The include paths to check for files.
   ///   (Note that other directories above these paths are ignored.

diff  --git a/clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap b/clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap
index fbb8e7db4d10c2..64180adf5beb35 100644
--- a/clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap
+++ b/clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap
@@ -1,4 +1,4 @@
-// module.map
+// module.modulemap
 
 module Level1A {
   header "Level1A.h"

diff  --git a/clang-tools-extra/test/modularize/Inputs/CoverageNoProblems/module.modulemap b/clang-tools-extra/test/modularize/Inputs/CoverageNoProblems/module.modulemap
index d2b0957b76e1ca..39af7d5dcf366e 100644
--- a/clang-tools-extra/test/modularize/Inputs/CoverageNoProblems/module.modulemap
+++ b/clang-tools-extra/test/modularize/Inputs/CoverageNoProblems/module.modulemap
@@ -1,4 +1,4 @@
-// module.map
+// module.modulemap
 
 module Level1A {
   header "Includes1/Level1A.h"

diff  --git a/clang-tools-extra/test/modularize/Inputs/CoverageProblems/module.modulemap b/clang-tools-extra/test/modularize/Inputs/CoverageProblems/module.modulemap
index dbe0bb8507cf0b..2b8b23054a0195 100644
--- a/clang-tools-extra/test/modularize/Inputs/CoverageProblems/module.modulemap
+++ b/clang-tools-extra/test/modularize/Inputs/CoverageProblems/module.modulemap
@@ -1,4 +1,4 @@
-// module.map
+// module.modulemap
 
 module Level1A {
   header "Level1A.h"

diff  --git a/clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap b/clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap
index daa06fca78d26b..9acb4923f9ac37 100644
--- a/clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap
+++ b/clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap
@@ -1,4 +1,4 @@
-// module.map
+// module.modulemap
 
 module Level1A {
   header "Level1A.h"

diff  --git a/clang-tools-extra/test/pp-trace/Inputs/module.map b/clang-tools-extra/test/pp-trace/Inputs/module.modulemap
similarity index 84%
rename from clang-tools-extra/test/pp-trace/Inputs/module.map
rename to clang-tools-extra/test/pp-trace/Inputs/module.modulemap
index 31f33c5bb14902..f16bbc6e2e05b4 100644
--- a/clang-tools-extra/test/pp-trace/Inputs/module.map
+++ b/clang-tools-extra/test/pp-trace/Inputs/module.modulemap
@@ -1,4 +1,4 @@
-// module.map
+// module.modulemap
 
 module Level1A {
   header "Level1A.h"

diff  --git a/clang/include/clang-c/BuildSystem.h b/clang/include/clang-c/BuildSystem.h
index 296e61247cef57..57e16af20a7006 100644
--- a/clang/include/clang-c/BuildSystem.h
+++ b/clang/include/clang-c/BuildSystem.h
@@ -95,7 +95,7 @@ CINDEX_LINKAGE void clang_free(void *buffer);
 CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay);
 
 /**
- * Object encapsulating information about a module.map file.
+ * Object encapsulating information about a module.modulemap file.
  */
 typedef struct CXModuleMapDescriptorImpl *CXModuleMapDescriptor;
 
@@ -109,7 +109,7 @@ CINDEX_LINKAGE CXModuleMapDescriptor
 clang_ModuleMapDescriptor_create(unsigned options);
 
 /**
- * Sets the framework module name that the module.map describes.
+ * Sets the framework module name that the module.modulemap describes.
  * \returns 0 for success, non-zero to indicate an error.
  */
 CINDEX_LINKAGE enum CXErrorCode
@@ -117,7 +117,7 @@ clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor,
                                                  const char *name);
 
 /**
- * Sets the umbrella header name that the module.map describes.
+ * Sets the umbrella header name that the module.modulemap describes.
  * \returns 0 for success, non-zero to indicate an error.
  */
 CINDEX_LINKAGE enum CXErrorCode

diff  --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td
index caee2dc6daadb6..80b5680b94f6ca 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -40,6 +40,7 @@ def : DiagGroup<"auto-import">;
 def FrameworkHdrQuotedInclude : DiagGroup<"quoted-include-in-framework-header">;
 def FrameworkIncludePrivateFromPublic :
   DiagGroup<"framework-include-private-from-public">;
+def DeprecatedModuleDotMap : DiagGroup<"deprecated-module-dot-map">;
 def FrameworkHdrAtImport : DiagGroup<"atimport-in-framework-header">;
 def CXX14BinaryLiteral : DiagGroup<"c++14-binary-literal">;
 def CXXPre14CompatBinaryLiteral : DiagGroup<"c++98-c++11-compat-binary-literal">;

diff  --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td
index 564ca48cc32ac5..75ca2fa16d3485 100644
--- a/clang/include/clang/Basic/DiagnosticLexKinds.td
+++ b/clang/include/clang/Basic/DiagnosticLexKinds.td
@@ -884,6 +884,9 @@ def warn_quoted_include_in_framework_header : Warning<
 def warn_framework_include_private_from_public : Warning<
   "public framework header includes private framework header '%0'"
   >, InGroup<FrameworkIncludePrivateFromPublic>;
+def warn_deprecated_module_dot_map : Warning<
+  "'%0' as a module map name is deprecated, rename it to %select{module.modulemap|module.private.modulemap}1%select{| in the 'Modules' directory of the framework}2">,
+  InGroup<DeprecatedModuleDotMap>;
 
 def remark_pp_include_directive_modular_translation : Remark<
   "treating #%select{include|import|include_next|__include_macros}0 as an "

diff  --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index f24013d68795ae..a0ac0eaf2f9004 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -1656,7 +1656,8 @@ bool HeaderSearch::findUsableModuleForFrameworkHeader(
 }
 
 static OptionalFileEntryRef getPrivateModuleMap(FileEntryRef File,
-                                                FileManager &FileMgr) {
+                                                FileManager &FileMgr,
+                                                DiagnosticsEngine &Diags) {
   StringRef Filename = llvm::sys::path::filename(File.getName());
   SmallString<128>  PrivateFilename(File.getDir().getName());
   if (Filename == "module.map")
@@ -1665,7 +1666,14 @@ static OptionalFileEntryRef getPrivateModuleMap(FileEntryRef File,
     llvm::sys::path::append(PrivateFilename, "module.private.modulemap");
   else
     return std::nullopt;
-  return FileMgr.getOptionalFileRef(PrivateFilename);
+  auto PMMFile = FileMgr.getOptionalFileRef(PrivateFilename);
+  if (PMMFile) {
+    if (Filename == "module.map")
+      Diags.Report(diag::warn_deprecated_module_dot_map)
+          << PrivateFilename << 1
+          << File.getDir().getName().endswith(".framework");
+  }
+  return PMMFile;
 }
 
 bool HeaderSearch::loadModuleMapFile(FileEntryRef File, bool IsSystem,
@@ -1731,7 +1739,8 @@ HeaderSearch::loadModuleMapFileImpl(FileEntryRef File, bool IsSystem,
   }
 
   // Try to load a corresponding private module map.
-  if (OptionalFileEntryRef PMMFile = getPrivateModuleMap(File, FileMgr)) {
+  if (OptionalFileEntryRef PMMFile =
+          getPrivateModuleMap(File, FileMgr, Diags)) {
     if (ModMap.parseModuleMapFile(*PMMFile, IsSystem, Dir)) {
       LoadedModuleMaps[File] = false;
       return LMM_InvalidModuleMap;
@@ -1755,11 +1764,14 @@ HeaderSearch::lookupModuleMapFile(DirectoryEntryRef Dir, bool IsFramework) {
   if (auto F = FileMgr.getOptionalFileRef(ModuleMapFileName))
     return *F;
 
-  // Continue to allow module.map
+  // Continue to allow module.map, but warn it's deprecated.
   ModuleMapFileName = Dir.getName();
   llvm::sys::path::append(ModuleMapFileName, "module.map");
-  if (auto F = FileMgr.getOptionalFileRef(ModuleMapFileName))
+  if (auto F = FileMgr.getOptionalFileRef(ModuleMapFileName)) {
+    Diags.Report(diag::warn_deprecated_module_dot_map)
+        << ModuleMapFileName << 0 << IsFramework;
     return *F;
+  }
 
   // For frameworks, allow to have a private module map with a preferred
   // spelling when a public module map is absent.

diff  --git a/clang/test/ARCMT/Inputs/module.map b/clang/test/ARCMT/Inputs/module.modulemap
similarity index 100%
rename from clang/test/ARCMT/Inputs/module.map
rename to clang/test/ARCMT/Inputs/module.modulemap

diff  --git a/clang/test/Index/Inputs/Frameworks/module.map b/clang/test/Index/Inputs/Frameworks/module.modulemap
similarity index 100%
rename from clang/test/Index/Inputs/Frameworks/module.map
rename to clang/test/Index/Inputs/Frameworks/module.modulemap

diff  --git a/clang/test/Index/Inputs/Headers/module.map b/clang/test/Index/Inputs/Headers/module.modulemap
similarity index 100%
rename from clang/test/Index/Inputs/Headers/module.map
rename to clang/test/Index/Inputs/Headers/module.modulemap

diff  --git a/clang/test/Index/Inputs/Headers/nested/module.map b/clang/test/Index/Inputs/Headers/nested/module.modulemap
similarity index 100%
rename from clang/test/Index/Inputs/Headers/nested/module.map
rename to clang/test/Index/Inputs/Headers/nested/module.modulemap

diff  --git a/clang/test/Index/Inputs/module.map b/clang/test/Index/Inputs/module.modulemap
similarity index 100%
rename from clang/test/Index/Inputs/module.map
rename to clang/test/Index/Inputs/module.modulemap

diff  --git a/clang/test/Index/Inputs/vfsoverlay.yaml b/clang/test/Index/Inputs/vfsoverlay.yaml
index 95b00bef7d0e4c..3e9718b4c4314f 100644
--- a/clang/test/Index/Inputs/vfsoverlay.yaml
+++ b/clang/test/Index/Inputs/vfsoverlay.yaml
@@ -3,8 +3,8 @@
   'roots': [
     { 'name': 'OUT_DIR', 'type': 'directory',
       'contents': [
-        { 'name': 'module.map', 'type': 'file',
-          'external-contents': 'INPUT_DIR/module.map'
+        { 'name': 'module.modulemap', 'type': 'file',
+          'external-contents': 'INPUT_DIR/module.modulemap'
         },
         { 'name': 'ModuleNeedsVFS.h', 'type': 'file',
           'external-contents': 'INPUT_DIR/module_needs_vfs.h'

diff  --git a/clang/test/Modules/Inputs/Conflicts/module.map b/clang/test/Modules/Inputs/Conflicts/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/Conflicts/module.map
rename to clang/test/Modules/Inputs/Conflicts/module.modulemap

diff  --git a/clang/test/Modules/Inputs/DependsOnModule.framework/module.map b/clang/test/Modules/Inputs/DependsOnModule.framework/Modules/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/DependsOnModule.framework/module.map
rename to clang/test/Modules/Inputs/DependsOnModule.framework/Modules/module.modulemap

diff  --git a/clang/test/Modules/Inputs/DependsOnModule.framework/module_private.map b/clang/test/Modules/Inputs/DependsOnModule.framework/Modules/module.private.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/DependsOnModule.framework/module_private.map
rename to clang/test/Modules/Inputs/DependsOnModule.framework/Modules/module.private.modulemap

diff  --git a/clang/test/Modules/Inputs/GNUAsm/NeedsGNUInlineAsm.framework/module.map b/clang/test/Modules/Inputs/GNUAsm/NeedsGNUInlineAsm.framework/Modules/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/GNUAsm/NeedsGNUInlineAsm.framework/module.map
rename to clang/test/Modules/Inputs/GNUAsm/NeedsGNUInlineAsm.framework/Modules/module.modulemap

diff  --git a/clang/test/Modules/Inputs/Modified/module.map b/clang/test/Modules/Inputs/Modified/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/Modified/module.map
rename to clang/test/Modules/Inputs/Modified/module.modulemap

diff  --git a/clang/test/Modules/Inputs/ModuleDiags/module.map b/clang/test/Modules/Inputs/ModuleDiags/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/ModuleDiags/module.map
rename to clang/test/Modules/Inputs/ModuleDiags/module.modulemap

diff  --git a/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/a.h b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/a.h
new file mode 100644
index 00000000000000..d571c6e4f799f3
--- /dev/null
+++ b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/a.h
@@ -0,0 +1 @@
+void will_be_found1(void);

diff  --git a/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/module.map b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/module.map
new file mode 100644
index 00000000000000..ef46443cedc925
--- /dev/null
+++ b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/module.map
@@ -0,0 +1,3 @@
+module module_map {
+  header "a.h"
+}

diff  --git a/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/module_private.map b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/module_private.map
new file mode 100644
index 00000000000000..d542172a1235e7
--- /dev/null
+++ b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/module_private.map
@@ -0,0 +1,3 @@
+module module_map.Private {
+  header "private.h"
+}

diff  --git a/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/private.h b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map/private.h
new file mode 100644
index 00000000000000..e69de29bb2d1d6

diff  --git a/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/Headers/a.h b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/Headers/a.h
new file mode 100644
index 00000000000000..e69de29bb2d1d6

diff  --git a/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/PrivateHeaders/private.h b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/PrivateHeaders/private.h
new file mode 100644
index 00000000000000..e69de29bb2d1d6

diff  --git a/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/module.map b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/module.map
new file mode 100644
index 00000000000000..f30545f8a88cdd
--- /dev/null
+++ b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/module.map
@@ -0,0 +1,3 @@
+framework module Module_Map_F {
+  header "a.h"
+}

diff  --git a/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/module_private.map b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/module_private.map
new file mode 100644
index 00000000000000..0b3b5a78b8741d
--- /dev/null
+++ b/clang/test/Modules/Inputs/ModuleMapLocations/Module_Map_F.framework/module_private.map
@@ -0,0 +1,3 @@
+explicit framework module Module_Map_F.Private {
+  header "private.h"
+}

diff  --git a/clang/test/Modules/Inputs/NoUmbrella.framework/module.map b/clang/test/Modules/Inputs/NoUmbrella.framework/Modules/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/NoUmbrella.framework/module.map
rename to clang/test/Modules/Inputs/NoUmbrella.framework/Modules/module.modulemap

diff  --git a/clang/test/Modules/Inputs/NoUmbrella.framework/module_private.map b/clang/test/Modules/Inputs/NoUmbrella.framework/Modules/module.private.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/NoUmbrella.framework/module_private.map
rename to clang/test/Modules/Inputs/NoUmbrella.framework/Modules/module.private.modulemap

diff  --git a/clang/test/Modules/Inputs/StdDef/module.map b/clang/test/Modules/Inputs/StdDef/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/StdDef/module.map
rename to clang/test/Modules/Inputs/StdDef/module.modulemap

diff  --git a/clang/test/Modules/Inputs/System/usr/include/module.map b/clang/test/Modules/Inputs/System/usr/include/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/System/usr/include/module.map
rename to clang/test/Modules/Inputs/System/usr/include/module.modulemap

diff  --git a/clang/test/Modules/Inputs/UseAfterFree/module.map b/clang/test/Modules/Inputs/UseAfterFree/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/UseAfterFree/module.map
rename to clang/test/Modules/Inputs/UseAfterFree/module.modulemap

diff  --git a/clang/test/Modules/Inputs/UseAfterFree/module_private.map b/clang/test/Modules/Inputs/UseAfterFree/module.private.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/UseAfterFree/module_private.map
rename to clang/test/Modules/Inputs/UseAfterFree/module.private.modulemap

diff  --git a/clang/test/Modules/Inputs/crash-recovery/usr/include/module.map b/clang/test/Modules/Inputs/crash-recovery/usr/include/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/crash-recovery/usr/include/module.map
rename to clang/test/Modules/Inputs/crash-recovery/usr/include/module.modulemap

diff  --git a/clang/test/Modules/Inputs/declare-use/module.map b/clang/test/Modules/Inputs/declare-use/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/declare-use/module.map
rename to clang/test/Modules/Inputs/declare-use/module.modulemap

diff  --git a/clang/test/Modules/Inputs/elsewhere/module.map b/clang/test/Modules/Inputs/elsewhere/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/elsewhere/module.map
rename to clang/test/Modules/Inputs/elsewhere/module.modulemap

diff  --git a/clang/test/Modules/Inputs/exclude-header/module.map b/clang/test/Modules/Inputs/exclude-header/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/exclude-header/module.map
rename to clang/test/Modules/Inputs/exclude-header/module.modulemap

diff  --git a/clang/test/Modules/Inputs/implicit-private-without-public/DeprecatedModuleMapLocation.framework/module_private.map b/clang/test/Modules/Inputs/implicit-private-without-public/DeprecatedModuleMapLocation.framework/module.private.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/implicit-private-without-public/DeprecatedModuleMapLocation.framework/module_private.map
rename to clang/test/Modules/Inputs/implicit-private-without-public/DeprecatedModuleMapLocation.framework/module.private.modulemap

diff  --git a/clang/test/Modules/Inputs/include-relative/module.map b/clang/test/Modules/Inputs/include-relative/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/include-relative/module.map
rename to clang/test/Modules/Inputs/include-relative/module.modulemap

diff  --git a/clang/test/Modules/Inputs/lookup-assert-protocol/module.map b/clang/test/Modules/Inputs/lookup-assert-protocol/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/lookup-assert-protocol/module.map
rename to clang/test/Modules/Inputs/lookup-assert-protocol/module.modulemap

diff  --git a/clang/test/Modules/Inputs/lookup-assert/module.map b/clang/test/Modules/Inputs/lookup-assert/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/lookup-assert/module.map
rename to clang/test/Modules/Inputs/lookup-assert/module.modulemap

diff  --git a/clang/test/Modules/Inputs/macro-undef-through-pch/module.map b/clang/test/Modules/Inputs/macro-undef-through-pch/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/macro-undef-through-pch/module.map
rename to clang/test/Modules/Inputs/macro-undef-through-pch/module.modulemap

diff  --git a/clang/test/Modules/Inputs/malformed/module.map b/clang/test/Modules/Inputs/malformed/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/malformed/module.map
rename to clang/test/Modules/Inputs/malformed/module.modulemap

diff  --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/module.map
rename to clang/test/Modules/Inputs/module.modulemap

diff  --git a/clang/test/Modules/Inputs/ms-enums/module.map b/clang/test/Modules/Inputs/ms-enums/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/ms-enums/module.map
rename to clang/test/Modules/Inputs/ms-enums/module.modulemap

diff  --git a/clang/test/Modules/Inputs/normal-module-map/Umbrella/module.map b/clang/test/Modules/Inputs/normal-module-map/Umbrella/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/normal-module-map/Umbrella/module.map
rename to clang/test/Modules/Inputs/normal-module-map/Umbrella/module.modulemap

diff  --git a/clang/test/Modules/Inputs/normal-module-map/Umbrella2/module.map b/clang/test/Modules/Inputs/normal-module-map/Umbrella2/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/normal-module-map/Umbrella2/module.map
rename to clang/test/Modules/Inputs/normal-module-map/Umbrella2/module.modulemap

diff  --git a/clang/test/Modules/Inputs/normal-module-map/module.map b/clang/test/Modules/Inputs/normal-module-map/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/normal-module-map/module.map
rename to clang/test/Modules/Inputs/normal-module-map/module.modulemap

diff  --git a/clang/test/Modules/Inputs/normal-module-map/nested/module.map b/clang/test/Modules/Inputs/normal-module-map/nested/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/normal-module-map/nested/module.map
rename to clang/test/Modules/Inputs/normal-module-map/nested/module.modulemap

diff  --git a/clang/test/Modules/Inputs/objc-category-2/module.map b/clang/test/Modules/Inputs/objc-category-2/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/objc-category-2/module.map
rename to clang/test/Modules/Inputs/objc-category-2/module.modulemap

diff  --git a/clang/test/Modules/Inputs/objc-category-3/module.map b/clang/test/Modules/Inputs/objc-category-3/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/objc-category-3/module.map
rename to clang/test/Modules/Inputs/objc-category-3/module.modulemap

diff  --git a/clang/test/Modules/Inputs/objc-category/module.map b/clang/test/Modules/Inputs/objc-category/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/objc-category/module.map
rename to clang/test/Modules/Inputs/objc-category/module.modulemap

diff  --git a/clang/test/Modules/Inputs/objc-hidden/System/module.map b/clang/test/Modules/Inputs/objc-hidden/System/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/objc-hidden/System/module.map
rename to clang/test/Modules/Inputs/objc-hidden/System/module.modulemap

diff  --git a/clang/test/Modules/Inputs/odr/module.map b/clang/test/Modules/Inputs/odr/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/odr/module.map
rename to clang/test/Modules/Inputs/odr/module.modulemap

diff  --git a/clang/test/Modules/Inputs/oldname/module.map b/clang/test/Modules/Inputs/oldname/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/oldname/module.map
rename to clang/test/Modules/Inputs/oldname/module.modulemap

diff  --git a/clang/test/Modules/Inputs/pr19692/module.map b/clang/test/Modules/Inputs/pr19692/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/pr19692/module.map
rename to clang/test/Modules/Inputs/pr19692/module.modulemap

diff  --git a/clang/test/Modules/Inputs/private/module.map b/clang/test/Modules/Inputs/private/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/private/module.map
rename to clang/test/Modules/Inputs/private/module.modulemap

diff  --git a/clang/test/Modules/Inputs/private1/module.map b/clang/test/Modules/Inputs/private1/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/private1/module.map
rename to clang/test/Modules/Inputs/private1/module.modulemap

diff  --git a/clang/test/Modules/Inputs/private2/module.map b/clang/test/Modules/Inputs/private2/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/private2/module.map
rename to clang/test/Modules/Inputs/private2/module.modulemap

diff  --git a/clang/test/Modules/Inputs/redecls/module.map b/clang/test/Modules/Inputs/redecls/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/redecls/module.map
rename to clang/test/Modules/Inputs/redecls/module.modulemap

diff  --git a/clang/test/Modules/Inputs/self-import-header/af.framework/module.map b/clang/test/Modules/Inputs/self-import-header/af.framework/Modules/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/self-import-header/af.framework/module.map
rename to clang/test/Modules/Inputs/self-import-header/af.framework/Modules/module.modulemap

diff  --git a/clang/test/Modules/Inputs/self-import-header/depend_builtin/module.map b/clang/test/Modules/Inputs/self-import-header/depend_builtin/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/self-import-header/depend_builtin/module.map
rename to clang/test/Modules/Inputs/self-import-header/depend_builtin/module.modulemap

diff  --git a/clang/test/Modules/Inputs/string_names/module.map b/clang/test/Modules/Inputs/string_names/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/string_names/module.map
rename to clang/test/Modules/Inputs/string_names/module.modulemap

diff  --git a/clang/test/Modules/Inputs/subdir/module.map b/clang/test/Modules/Inputs/subdir/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/subdir/module.map
rename to clang/test/Modules/Inputs/subdir/module.modulemap

diff  --git a/clang/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map b/clang/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map
rename to clang/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.modulemap

diff  --git a/clang/test/Modules/Inputs/submodules/module.map b/clang/test/Modules/Inputs/submodules/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/submodules/module.map
rename to clang/test/Modules/Inputs/submodules/module.modulemap

diff  --git a/clang/test/Modules/Inputs/system-out-of-date/module.map b/clang/test/Modules/Inputs/system-out-of-date/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/system-out-of-date/module.map
rename to clang/test/Modules/Inputs/system-out-of-date/module.modulemap

diff  --git a/clang/test/Modules/Inputs/template-specialization-visibility/module.map b/clang/test/Modules/Inputs/template-specialization-visibility/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/template-specialization-visibility/module.map
rename to clang/test/Modules/Inputs/template-specialization-visibility/module.modulemap

diff  --git a/clang/test/Modules/Inputs/thread-safety/module.map b/clang/test/Modules/Inputs/thread-safety/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/thread-safety/module.map
rename to clang/test/Modules/Inputs/thread-safety/module.modulemap

diff  --git a/clang/test/Modules/Inputs/undefined-type-fixit/module.map b/clang/test/Modules/Inputs/undefined-type-fixit/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/undefined-type-fixit/module.map
rename to clang/test/Modules/Inputs/undefined-type-fixit/module.modulemap

diff  --git a/clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.map b/clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.map
rename to clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.modulemap

diff  --git a/clang/test/Modules/Inputs/update-after-load/module.map b/clang/test/Modules/Inputs/update-after-load/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/update-after-load/module.map
rename to clang/test/Modules/Inputs/update-after-load/module.modulemap

diff  --git a/clang/test/Modules/Inputs/wildcard-submodule-exports/module.map b/clang/test/Modules/Inputs/wildcard-submodule-exports/module.modulemap
similarity index 100%
rename from clang/test/Modules/Inputs/wildcard-submodule-exports/module.map
rename to clang/test/Modules/Inputs/wildcard-submodule-exports/module.modulemap

diff  --git a/clang/test/Modules/concept_
diff er.cpp b/clang/test/Modules/concept_
diff er.cpp
index 23c7d4c5ecf9ab..9c1d292f29274b 100644
--- a/clang/test/Modules/concept_
diff er.cpp
+++ b/clang/test/Modules/concept_
diff er.cpp
@@ -2,9 +2,9 @@
 // RUN: mkdir %t
 // RUN: split-file %s %t
 //
-// RUN: %clang_cc1 -x c++ -std=c++20 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%t/module.map %t/foo.cpp -verify
+// RUN: %clang_cc1 -x c++ -std=c++20 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%t/module.modulemap %t/foo.cpp -verify
 
-//--- module.map
+//--- module.modulemap
 module "foo" {
   export * 
   header "foo.h"

diff  --git a/clang/test/Modules/config_macros.m b/clang/test/Modules/config_macros.m
index dd071993809beb..15e2c16606ba29 100644
--- a/clang/test/Modules/config_macros.m
+++ b/clang/test/Modules/config_macros.m
@@ -23,6 +23,6 @@
 @import config; // expected-warning{{definition of configuration macro 'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on the command line to configure the module}}
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -std=c99 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -DWANT_FOO=1 -emit-module -fmodule-name=config %S/Inputs/module.map
+// RUN: %clang_cc1 -std=c99 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -DWANT_FOO=1 -emit-module -fmodule-name=config %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -std=c99 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -DWANT_FOO=1 %s -verify
 

diff  --git a/clang/test/Modules/crash-vfs-ivfsoverlay.m b/clang/test/Modules/crash-vfs-ivfsoverlay.m
index d2d2ccbd2546bc..32489457d73628 100644
--- a/clang/test/Modules/crash-vfs-ivfsoverlay.m
+++ b/clang/test/Modules/crash-vfs-ivfsoverlay.m
@@ -41,5 +41,5 @@
 // CHECKYAML: 'contents': [
 // CHECKYAML-NEXT:   {
 // CHECKYAML-NEXT:     'type': 'file',
-// CHECKYAML-NEXT:     'name': "module.map",
+// CHECKYAML-NEXT:     'name': "module.modulemap",
 // CHECKYAML-NEXT:     'external-contents': "/[[OTHERPATH:.*]]/actual_module2.map"

diff  --git a/clang/test/Modules/crash-vfs-path-symlink-component.m b/clang/test/Modules/crash-vfs-path-symlink-component.m
index 8280cd79bbc21c..fe6e4d6ff42457 100644
--- a/clang/test/Modules/crash-vfs-path-symlink-component.m
+++ b/clang/test/Modules/crash-vfs-path-symlink-component.m
@@ -49,8 +49,8 @@
 // CHECKYAML-NEXT: 'contents': [
 // CHECKYAML-NEXT:   {
 // CHECKYAML-NEXT:     'type': 'file',
-// CHECKYAML-NEXT:     'name': "module.map",
-// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/i/usr/include/module.map"
+// CHECKYAML-NEXT:     'name': "module.modulemap",
+// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/i/usr/include/module.modulemap"
 // CHECKYAML-NEXT:   },
 
 // Test that by using the previous generated YAML file clang is able to find the

diff  --git a/clang/test/Modules/crash-vfs-path-traversal.m b/clang/test/Modules/crash-vfs-path-traversal.m
index 891c7960f08b1f..d6c9a0f2aeb8a2 100644
--- a/clang/test/Modules/crash-vfs-path-traversal.m
+++ b/clang/test/Modules/crash-vfs-path-traversal.m
@@ -46,8 +46,8 @@
 // CHECKYAML-NEXT: 'contents': [
 // CHECKYAML-NEXT:   {
 // CHECKYAML-NEXT:     'type': 'file',
-// CHECKYAML-NEXT:     'name': "module.map",
-// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.map"
+// CHECKYAML-NEXT:     'name': "module.modulemap",
+// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.modulemap"
 // CHECKYAML-NEXT:   },
 
 // Replace the paths in the YAML files with relative ".." traversals

diff  --git a/clang/test/Modules/crash-vfs-relative-incdir.m b/clang/test/Modules/crash-vfs-relative-incdir.m
index e35c1e9fdb6591..c0407f776778b1 100644
--- a/clang/test/Modules/crash-vfs-relative-incdir.m
+++ b/clang/test/Modules/crash-vfs-relative-incdir.m
@@ -41,9 +41,9 @@
 // CHECKYAML-NEXT: 'contents': [
 // CHECKYAML-NEXT:   {
 // CHECKYAML-NEXT:     'type': 'file',
-// CHECKYAML-NEXT:     'name': "module.map",
+// CHECKYAML-NEXT:     'name': "module.modulemap",
 // CHECKYAML-NOT:      'external-contents': "{{[^ ]*}}.cache
-// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.map"
+// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.modulemap"
 // CHECKYAML-NEXT:   },
 
 // Run the reproducer script - regular exit code is enough to test it works.

diff  --git a/clang/test/Modules/crash-vfs-relative-overlay.m b/clang/test/Modules/crash-vfs-relative-overlay.m
index ce2902417943c9..27f9c8d8906665 100644
--- a/clang/test/Modules/crash-vfs-relative-overlay.m
+++ b/clang/test/Modules/crash-vfs-relative-overlay.m
@@ -44,9 +44,9 @@
 // CHECKYAML-NEXT: 'contents': [
 // CHECKYAML-NEXT:   {
 // CHECKYAML-NEXT:     'type': 'file',
-// CHECKYAML-NEXT:     'name': "module.map",
+// CHECKYAML-NEXT:     'name': "module.modulemap",
 // CHECKYAML-NOT:      'external-contents': "{{[^ ]*}}.cache
-// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.map"
+// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.modulemap"
 // CHECKYAML-NEXT:   },
 
 // Test that reading the YAML file will yield the correct path after

diff  --git a/clang/test/Modules/crash-vfs-run-reproducer.m b/clang/test/Modules/crash-vfs-run-reproducer.m
index d43f7b5e4475da..fd861fed5a6038 100644
--- a/clang/test/Modules/crash-vfs-run-reproducer.m
+++ b/clang/test/Modules/crash-vfs-run-reproducer.m
@@ -41,9 +41,9 @@
 // CHECKYAML-NEXT: 'contents': [
 // CHECKYAML-NEXT:   {
 // CHECKYAML-NEXT:     'type': 'file',
-// CHECKYAML-NEXT:     'name': "module.map",
+// CHECKYAML-NEXT:     'name': "module.modulemap",
 // CHECKYAML-NOT:      'external-contents': "{{[^ ]*}}.cache
-// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.map"
+// CHECKYAML-NEXT:     'external-contents': "/[[PATH]]/Inputs/crash-recovery/usr/include/module.modulemap"
 // CHECKYAML-NEXT:   },
 
 // Run the reproducer script - regular exit code is enough to test it works.

diff  --git a/clang/test/Modules/declare-use-compatible.cpp b/clang/test/Modules/declare-use-compatible.cpp
index a2e7f01c6c1d19..75ef5b00508d4c 100644
--- a/clang/test/Modules/declare-use-compatible.cpp
+++ b/clang/test/Modules/declare-use-compatible.cpp
@@ -1,7 +1,7 @@
 // Used module not built with -decluse.
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -x c++ -fmodules -fimplicit-module-maps -fmodule-name=XB -emit-module \
-// RUN:   -I %S/Inputs/declare-use %S/Inputs/declare-use/module.map -o %t/b.pcm
+// RUN:   -I %S/Inputs/declare-use %S/Inputs/declare-use/module.modulemap -o %t/b.pcm
 // RUN: %clang_cc1 -x c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
 // RUN:   -fmodules-decluse \
 // RUN:   -fmodule-file=%t/b.pcm -fmodule-name=XE -I %S/Inputs/declare-use %s
@@ -10,14 +10,14 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -x c++ -fmodules -fimplicit-module-maps -fmodule-name=XB -emit-module \
 // RUN:   -fmodules-decluse \
-// RUN:   -I %S/Inputs/declare-use %S/Inputs/declare-use/module.map -o %t/b.pcm
+// RUN:   -I %S/Inputs/declare-use %S/Inputs/declare-use/module.modulemap -o %t/b.pcm
 // RUN: %clang_cc1 -x c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
 // RUN:   -fmodule-file=%t/b.pcm -fmodule-name=XE -I %S/Inputs/declare-use %s
 //
 // Used module not built with -decluse.
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -x c++ -fmodules -fimplicit-module-maps -fmodule-name=XB -emit-module \
-// RUN:   -I %S/Inputs/declare-use %S/Inputs/declare-use/module.map -o %t/b.pcm
+// RUN:   -I %S/Inputs/declare-use %S/Inputs/declare-use/module.modulemap -o %t/b.pcm
 // RUN: %clang_cc1 -x c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
 // RUN:   -fmodules-strict-decluse \
 // RUN:   -fmodule-file=%t/b.pcm -fmodule-name=XE -I %S/Inputs/declare-use %s
@@ -26,7 +26,7 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -x c++ -fmodules -fimplicit-module-maps -fmodule-name=XB -emit-module \
 // RUN:   -fmodules-strict-decluse \
-// RUN:   -I %S/Inputs/declare-use %S/Inputs/declare-use/module.map -o %t/b.pcm
+// RUN:   -I %S/Inputs/declare-use %S/Inputs/declare-use/module.modulemap -o %t/b.pcm
 // RUN: %clang_cc1 -x c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
 // RUN:   -fmodule-file=%t/b.pcm -fmodule-name=XE -I %S/Inputs/declare-use %s
 

diff  --git a/clang/test/Modules/dependency-gen-pch.m b/clang/test/Modules/dependency-gen-pch.m
index 589865e71d68ae..bdc226ffe33c8a 100644
--- a/clang/test/Modules/dependency-gen-pch.m
+++ b/clang/test/Modules/dependency-gen-pch.m
@@ -6,7 +6,7 @@
 // RUN: FileCheck %s < %t.d
 // CHECK: dependency-gen-pch.m.o
 // CHECK-NEXT: dependency-gen-pch.m
-// CHECK-NEXT: Inputs{{.}}module.map
+// CHECK-NEXT: Inputs{{.}}module.modulemap
 // CHECK-NEXT: diamond_top.pcm
 // CHECK-NEXT: Inputs{{.}}diamond_top.h
 

diff  --git a/clang/test/Modules/dependency-gen.m b/clang/test/Modules/dependency-gen.m
index cb0a8759560521..cdf170238d6f67 100644
--- a/clang/test/Modules/dependency-gen.m
+++ b/clang/test/Modules/dependency-gen.m
@@ -4,18 +4,18 @@
 // RUN: %clang_cc1 -x objective-c -isystem %S/Inputs/System/usr/include -dependency-file %t.d.1 -MT %s.o -I %S/Inputs -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-mcp %s
 // RUN: FileCheck %s < %t.d.1
 // CHECK: dependency-gen.m
-// CHECK: Inputs{{.}}module.map
+// CHECK: Inputs{{.}}module.modulemap
 // CHECK: Inputs{{.}}diamond_top.h
-// CHECK-NOT: usr{{.}}include{{.}}module.map
+// CHECK-NOT: usr{{.}}include{{.}}module.modulemap
 // CHECK-NOT: stdint.h
 
 
 // RUN: %clang_cc1 -x objective-c -isystem %S/Inputs/System/usr/include -dependency-file %t.d.2 -MT %s.o -I %S/Inputs -sys-header-deps -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-mcp %s
 // RUN: FileCheck %s -check-prefix=CHECK-SYS < %t.d.2
 // CHECK-SYS: dependency-gen.m
-// CHECK-SYS: Inputs{{.}}module.map
+// CHECK-SYS: Inputs{{.}}module.modulemap
 // CHECK-SYS: Inputs{{.}}diamond_top.h
-// CHECK-SYS: usr{{.}}include{{.}}module.map
+// CHECK-SYS: usr{{.}}include{{.}}module.modulemap
 // CHECK-SYS: stdint.h
 
 #import "diamond_top.h"

diff  --git a/clang/test/Modules/diag-flags.cpp b/clang/test/Modules/diag-flags.cpp
index 0db8b4412673d3..9301477b4591d8 100644
--- a/clang/test/Modules/diag-flags.cpp
+++ b/clang/test/Modules/diag-flags.cpp
@@ -1,32 +1,32 @@
 // RUN: rm -rf %t
 //
 // For an implicit module, all that matters are the warning flags in the user.
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodules-cache-path=%t -fmodule-name=diag_flags -x c++ %S/Inputs/module.map -std=c++20
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodules-cache-path=%t -fmodule-name=diag_flags -x c++ %S/Inputs/module.modulemap -std=c++20
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DWARNING -DLOCAL_WARNING -Wpadded
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DERROR -DLOCAL_ERROR -Wpadded -Werror
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DERROR -DLOCAL_ERROR -Werror=padded
 //
 // For an explicit module, all that matters are the warning flags in the module build.
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.map -std=c++20 -o %t/nodiag.pcm
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.modulemap -std=c++20 -o %t/nodiag.pcm
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -fmodule-file=%t/nodiag.pcm -Wpadded -DLOCAL_WARNING
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -fmodule-file=%t/nodiag.pcm -Werror -Wpadded -DLOCAL_ERROR
 //
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.map -std=c++20 -o %t/warning.pcm -Wpadded
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.modulemap -std=c++20 -o %t/warning.pcm -Wpadded
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DWARNING -fmodule-file=%t/warning.pcm
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DWARNING -fmodule-file=%t/warning.pcm -Werror=padded -DLOCAL_ERROR
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DWARNING -fmodule-file=%t/warning.pcm -Werror
 //
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.map -std=c++20 -o %t/werror-no-error.pcm -Werror -Wpadded -Wno-error=padded
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.modulemap -std=c++20 -o %t/werror-no-error.pcm -Werror -Wpadded -Wno-error=padded
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DWARNING -fmodule-file=%t/werror-no-error.pcm
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DWARNING -fmodule-file=%t/werror-no-error.pcm -Wno-padded
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DWARNING -fmodule-file=%t/werror-no-error.pcm -Werror=padded -DLOCAL_ERROR
 //
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.map -std=c++20 -o %t/error.pcm -Werror=padded
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.modulemap -std=c++20 -o %t/error.pcm -Werror=padded
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DERROR -fmodule-file=%t/error.pcm -Wno-padded
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DERROR -fmodule-file=%t/error.pcm -Wno-error=padded
 //
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.map -std=c++20 -o %t/werror.pcm -Werror -Wpadded
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.modulemap -std=c++20 -o %t/werror.pcm -Werror -Wpadded
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DERROR -fmodule-file=%t/werror.pcm -Wno-error
 // RUN: %clang_cc1 -triple %itanium_abi_triple -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DERROR -fmodule-file=%t/werror.pcm -Wno-padded
 

diff  --git a/clang/test/Modules/diag-pragma.c b/clang/test/Modules/diag-pragma.c
index 63be4bf93afcfb..80224629a1c81e 100644
--- a/clang/test/Modules/diag-pragma.c
+++ b/clang/test/Modules/diag-pragma.c
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diag_pragma %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diag_pragma %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -verify -fmodules-cache-path=%t -I %S/Inputs %s
 // FIXME: When we have a syntax for modules in C, use that.
 

diff  --git a/clang/test/Modules/diag-pragma.cpp b/clang/test/Modules/diag-pragma.cpp
index b1f10365e2356c..4b6318045372a8 100644
--- a/clang/test/Modules/diag-pragma.cpp
+++ b/clang/test/Modules/diag-pragma.cpp
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -emit-module -fmodules-cache-path=%t -fmodule-name=diag_pragma -x c++ %S/Inputs/module.map -std=c++20
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -emit-module -fmodules-cache-path=%t -fmodule-name=diag_pragma -x c++ %S/Inputs/module.modulemap -std=c++20
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_pragma -x c++ %S/Inputs/module.map -std=c++20 -o %t/explicit.pcm -Werror=string-plus-int
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_pragma -x c++ %S/Inputs/module.modulemap -std=c++20 -o %t/explicit.pcm -Werror=string-plus-int
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -std=c++20 -DEXPLICIT_FLAG -fmodule-file=%t/explicit.pcm
 
 #include "diag_pragma.h"

diff  --git a/clang/test/Modules/diamond-pch.c b/clang/test/Modules/diamond-pch.c
index 41cfd9c53b85a0..b60420cb8ed0b3 100644
--- a/clang/test/Modules/diamond-pch.c
+++ b/clang/test/Modules/diamond-pch.c
@@ -1,8 +1,8 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_top %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_left %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_right %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_bottom %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_top %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_left %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_right %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_bottom %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-pch -fmodules-cache-path=%t -I %S/Inputs -o %t.pch %S/Inputs/diamond.h
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -include-pch %t.pch %s -I %S/Inputs -verify
 // FIXME: When we have a syntax for modules in C, use that.

diff  --git a/clang/test/Modules/diamond.c b/clang/test/Modules/diamond.c
index c2e009fbc1d98a..1e0641cafd87b0 100644
--- a/clang/test/Modules/diamond.c
+++ b/clang/test/Modules/diamond.c
@@ -1,8 +1,8 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_top %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_left %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_right %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_bottom %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_top %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_left %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_right %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diamond_bottom %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -I %S/Inputs %s -verify
 // FIXME: When we have a syntax for modules in C, use that.
 

diff  --git a/clang/test/Modules/extern_c_bad.cpp b/clang/test/Modules/extern_c_bad.cpp
index c34416a4b71563..cd4e5abdfbfa73 100644
--- a/clang/test/Modules/extern_c_bad.cpp
+++ b/clang/test/Modules/extern_c_bad.cpp
@@ -1,2 +1,2 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -x c++ -emit-module -fmodules-cache-path=%t -fmodule-name=c_library_bad %S/Inputs/module.map
+// RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -x c++ -emit-module -fmodules-cache-path=%t -fmodule-name=c_library_bad %S/Inputs/module.modulemap

diff  --git a/clang/test/Modules/fmodules-validate-once-per-build-session.c b/clang/test/Modules/fmodules-validate-once-per-build-session.c
index 7ab6f78c194fdb..c3e67834802b64 100644
--- a/clang/test/Modules/fmodules-validate-once-per-build-session.c
+++ b/clang/test/Modules/fmodules-validate-once-per-build-session.c
@@ -11,8 +11,8 @@
 // foo.h as a system header.
 // RUN: echo 'void meow(void);' > %t/Inputs/foo.h
 // RUN: echo 'void woof(void);' > %t/Inputs/bar.h
-// RUN: echo 'module Foo { header "foo.h" }' > %t/Inputs/module.map
-// RUN: echo 'extern module Bar "bar.modulemap"' >> %t/Inputs/module.map
+// RUN: echo 'module Foo { header "foo.h" }' > %t/Inputs/module.modulemap
+// RUN: echo 'extern module Bar "bar.modulemap"' >> %t/Inputs/module.modulemap
 // RUN: echo 'module Bar { header "bar.h" }' > %t/Inputs/bar.modulemap
 
 // ===
@@ -53,7 +53,7 @@
 
 // ===
 // Use the module, and make sure that we did not recompile it if foo.h or
-// module.map are system files, even though the sources changed.
+// module.modulemap are system files, even though the sources changed.
 // RUN: %clang_cc1 -cc1 -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -fsyntax-only -isystem %t/Inputs -fmodules-validate-system-headers -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s
 // RUN: %clang_cc1 -cc1 -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t/modules-cache-user -fsyntax-only -I %t/Inputs -fmodules-validate-system-headers -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s
 // RUN: ls -R %t/modules-cache | grep Foo.pcm.timestamp

diff  --git a/clang/test/Modules/fsystem-module.m b/clang/test/Modules/fsystem-module.m
index 6ef91b762b0f4e..7eeb35d18f0a11 100644
--- a/clang/test/Modules/fsystem-module.m
+++ b/clang/test/Modules/fsystem-module.m
@@ -6,13 +6,13 @@
 
 // RUN: not %clang_cc1 -fmodules -I %S/Inputs \
 // RUN:   -emit-module -fmodule-name=warning -pedantic -Werror \
-// RUN:   %S/Inputs/module.map -o %t.dir/warning.pcm
+// RUN:   %S/Inputs/module.modulemap -o %t.dir/warning.pcm
 
 // RUN: %clang_cc1 -fmodules -I %S/Inputs \
 // RUN:   -emit-module -fmodule-name=warning -pedantic -Werror \
-// RUN:   %S/Inputs/module.map -o %t.dir/warning-system.pcm -fsystem-module
+// RUN:   %S/Inputs/module.modulemap -o %t.dir/warning-system.pcm -fsystem-module
 
 // RUN: not %clang_cc1 -fmodules -I %S/Inputs \
 // RUN:   -emit-module -fmodule-name=warning -pedantic -Werror \
-// RUN:   %S/Inputs/module.map -o %t.dir/warning-system.pcm -fsystem-module \
+// RUN:   %S/Inputs/module.modulemap -o %t.dir/warning-system.pcm -fsystem-module \
 // RUN:   -Wsystem-headers

diff  --git a/clang/test/Modules/irgen.c b/clang/test/Modules/irgen.c
index 92bd855c90753f..a1e07eb1d87e9a 100644
--- a/clang/test/Modules/irgen.c
+++ b/clang/test/Modules/irgen.c
@@ -1,6 +1,6 @@
 // REQUIRES: x86-registered-target
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=irgen -triple x86_64-apple-darwin10 %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=irgen -triple x86_64-apple-darwin10 %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -I %S/Inputs -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
 // FIXME: When we have a syntax for modules in C, use that.
 

diff  --git a/clang/test/Modules/linkage-merge.m b/clang/test/Modules/linkage-merge.m
index e7b9e5cec13678..c38524fa577beb 100644
--- a/clang/test/Modules/linkage-merge.m
+++ b/clang/test/Modules/linkage-merge.m
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=linkage_merge_left %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=linkage_merge_left %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -w %s -verify
 
 // Test redeclarations of functions where the original declaration is

diff  --git a/clang/test/Modules/load_failure.c b/clang/test/Modules/load_failure.c
index 6e63ba2adb196e..3a8d29597348da 100644
--- a/clang/test/Modules/load_failure.c
+++ b/clang/test/Modules/load_failure.c
@@ -7,7 +7,7 @@
 #endif
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -fdisable-module-hash -emit-module -fmodule-name=load_failure %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -fdisable-module-hash -emit-module -fmodule-name=load_failure %S/Inputs/module.modulemap
 // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -I %S/Inputs -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s
 // CHECK-NONEXISTENT: load_failure.c:2:9: fatal error: module 'load_nonexistent' not found
 

diff  --git a/clang/test/Modules/lookup.cpp b/clang/test/Modules/lookup.cpp
index e847d78b274f1f..95c30bf3eedffe 100644
--- a/clang/test/Modules/lookup.cpp
+++ b/clang/test/Modules/lookup.cpp
@@ -24,8 +24,8 @@ void f() {
 }
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_left_cxx %S/Inputs/module.map -verify
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_right_cxx %S/Inputs/module.map -verify
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_left_cxx %S/Inputs/module.modulemap -verify
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -emit-module -fmodules-cache-path=%t -fmodule-name=lookup_right_cxx %S/Inputs/module.modulemap -verify
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s -verify
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -ast-print -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s | FileCheck -check-prefix=CHECK-PRINT %s
 // FIXME: When we have a syntax for modules in C++, use that.

diff  --git a/clang/test/Modules/lookup.m b/clang/test/Modules/lookup.m
index 0e09bfdd7fd957..33e0408d8481df 100644
--- a/clang/test/Modules/lookup.m
+++ b/clang/test/Modules/lookup.m
@@ -1,6 +1,6 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -emit-module -x objective-c -fmodule-name=lookup_left_objc %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -emit-module -x objective-c -fmodule-name=lookup_right_objc %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -emit-module -x objective-c -fmodule-name=lookup_left_objc %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -emit-module -x objective-c -fmodule-name=lookup_right_objc %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -I %S/Inputs -verify %s
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -ast-print -x objective-c -fmodules-cache-path=%t -I %S/Inputs %s | FileCheck -check-prefix=CHECK-PRINT %s
 

diff  --git a/clang/test/Modules/merge-concepts.cppm b/clang/test/Modules/merge-concepts.cppm
index 9b611bc2f1b5e8..f8a763adaff661 100644
--- a/clang/test/Modules/merge-concepts.cppm
+++ b/clang/test/Modules/merge-concepts.cppm
@@ -24,16 +24,16 @@
 //
 // RUN: rm -f %t/foo.pcm
 // RUN: %clang_cc1 -std=c++20 -fmodules -fmodules-cache-path=%t -fprebuilt-module-path=%t \
-// RUN:   -fmodule-map-file=%t/module.map %t/Use7.cpp -verify -fsyntax-only
+// RUN:   -fmodule-map-file=%t/module.modulemap %t/Use7.cpp -verify -fsyntax-only
 // RUN: %clang_cc1 -std=c++20 -fmodules -fmodules-cache-path=%t -fprebuilt-module-path=%t \
-// RUN:   -fmodule-map-file=%t/module.map %t/Use7.cpp -verify -fsyntax-only
+// RUN:   -fmodule-map-file=%t/module.modulemap %t/Use7.cpp -verify -fsyntax-only
 // Testing module map modules with named modules.
-// RUN: %clang_cc1 -std=c++20 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%t/module.map \
+// RUN: %clang_cc1 -std=c++20 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%t/module.modulemap \
 // RUN:   %t/A.cppm -o %t/A.pcm
 // RUN: %clang_cc1 -std=c++20 -fmodules -fmodules-cache-path=%t -fprebuilt-module-path=%t \
-// RUN:   -fmodule-map-file=%t/module.map %t/Use7.cpp -verify -fsyntax-only
+// RUN:   -fmodule-map-file=%t/module.modulemap %t/Use7.cpp -verify -fsyntax-only
 // RUN: %clang_cc1 -std=c++20 -fmodules -fmodules-cache-path=%t -fprebuilt-module-path=%t \
-// RUN:   -fmodule-map-file=%t/module.map %t/Use7.cpp -verify -fsyntax-only
+// RUN:   -fmodule-map-file=%t/module.modulemap %t/Use7.cpp -verify -fsyntax-only
 
 //
 //--- foo.h
@@ -158,7 +158,7 @@ template <class T> void foo()
   requires same_as<T, int>
 {}
 
-//--- module.map
+//--- module.modulemap
 module "foo" {
   export * 
   header "foo.h"

diff  --git a/clang/test/Modules/missing-header.m b/clang/test/Modules/missing-header.m
index d865078e3a2f84..c162e1b5f08b3c 100644
--- a/clang/test/Modules/missing-header.m
+++ b/clang/test/Modules/missing-header.m
@@ -9,5 +9,5 @@
 // CHECK-NOT: missing_unavailable_headers
 
 @import missing_headers;
-// CHECK: module.map:15:27: error: header 'missing.h' not found
+// CHECK: module.modulemap:15:27: error: header 'missing.h' not found
 // CHECK: could not build module 'missing_headers'

diff  --git a/clang/test/Modules/modify-module.m b/clang/test/Modules/modify-module.m
index d59a4799104ff1..903bf4018b01af 100644
--- a/clang/test/Modules/modify-module.m
+++ b/clang/test/Modules/modify-module.m
@@ -5,7 +5,7 @@
 // RUN: mkdir -p %t/include
 // RUN: cat %S/Inputs/Modified/A.h > %t/include/A.h
 // RUN: cat %S/Inputs/Modified/B.h > %t/include/B.h
-// RUN: cat %S/Inputs/Modified/module.map > %t/include/module.map
+// RUN: cat %S/Inputs/Modified/module.modulemap > %t/include/module.modulemap
 // RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t/include %s -verify
 // RUN: echo '' >> %t/include/B.h
 // RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t/include %s -verify

diff  --git a/clang/test/Modules/module-file-home-is-cwd.m b/clang/test/Modules/module-file-home-is-cwd.m
index a3875d578bb603..13495ebf06fb7b 100644
--- a/clang/test/Modules/module-file-home-is-cwd.m
+++ b/clang/test/Modules/module-file-home-is-cwd.m
@@ -2,13 +2,13 @@
 // RUN: cd %S
 // RUN: %clang_cc1 -x objective-c -fmodules -fno-implicit-modules \
 // RUN:     -fmodule-file-home-is-cwd -fmodule-name=libA -emit-module \
-// RUN:     -fmodules-embed-all-files %S/Inputs/normal-module-map/module.map \
+// RUN:     -fmodules-embed-all-files %S/Inputs/normal-module-map/module.modulemap \
 // RUN:     -o %t/mod.pcm
 // RUN: llvm-bcanalyzer --dump --disable-histogram %t/mod.pcm | FileCheck %s
 // RUN: llvm-bcanalyzer --dump --disable-histogram %t/mod.pcm | FileCheck %s --check-prefix=INPUT
 
 // CHECK-NOT: MODULE_DIRECTORY
-// INPUT: <INPUT_FILE {{.*}}/> blob data = 'Inputs{{/|\\}}normal-module-map{{/|\\}}module.map'
+// INPUT: <INPUT_FILE {{.*}}/> blob data = 'Inputs{{/|\\}}normal-module-map{{/|\\}}module.modulemap'
 // INPUT: <INPUT_FILE {{.*}}/> blob data = 'Inputs{{/|\\}}normal-module-map{{/|\\}}a2.h'
 // INPUT: <INPUT_FILE {{.*}}/> blob data = 'Inputs{{/|\\}}normal-module-map{{/|\\}}a1.h'
 
@@ -17,7 +17,7 @@
 // RUN: cd %t
 // RUN: %clang_cc1 -x objective-c -fmodules -fno-implicit-modules -debug-info-kind=limited \
 // RUN:     -debugger-tuning=lldb -dwarf-ext-refs -fmodule-file-home-is-cwd \
-// RUN:     -fmodule-map-file=%S/Inputs/normal-module-map/module.map \
+// RUN:     -fmodule-map-file=%S/Inputs/normal-module-map/module.modulemap \
 // RUN:     -fmodule-file=libA=mod.pcm -emit-llvm -o %t-mod.ll %s
 // RUN: cat %t-mod.ll | FileCheck %s --check-prefix=SKELETON
 

diff  --git a/clang/test/Modules/module-private.cpp b/clang/test/Modules/module-private.cpp
index 2848226ba067c6..4036c345ef3c93 100644
--- a/clang/test/Modules/module-private.cpp
+++ b/clang/test/Modules/module-private.cpp
@@ -1,6 +1,6 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -std=c++17 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -fmodule-name=module_private_left -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -std=c++17 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -fmodule-name=module_private_right -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -std=c++17 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -fmodule-name=module_private_left -emit-module %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -std=c++17 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -fmodule-name=module_private_right -emit-module %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -std=c++17 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s -verify
 // FIXME: When we have a syntax for modules in C++, use that.
 

diff  --git a/clang/test/Modules/module_file_info.m b/clang/test/Modules/module_file_info.m
index 179c7f35df4ac0..f5ba25d54b97c5 100644
--- a/clang/test/Modules/module_file_info.m
+++ b/clang/test/Modules/module_file_info.m
@@ -16,7 +16,7 @@
 // CHECK: Generated by this Clang:
 
 // CHECK: Module name: DependsOnModule
-// CHECK: Module map file: {{.*}}DependsOnModule.framework{{[/\\]}}module.map
+// CHECK: Module map file: {{.*}}DependsOnModule.framework{{[/\\]}}Modules{{[/\\]}}module.modulemap
 // CHECK: Imports module 'Module': {{.*}}Module{{.*}}.pcm
 
 // CHECK: Language options:
@@ -47,10 +47,10 @@
 // MACROS:   Predefined macros:
 // MACROS-NEXT: -DBLARG
 // MACROS-NEXT: -DWIBBLE=WOBBLE
-// CHECK: Input file: {{.*}}module.map
-// CHECK-NEXT: Input file: {{.*}}module_private.map
+// CHECK: Input file: {{.*}}module.modulemap
+// CHECK-NEXT: Input file: {{.*}}module.private.modulemap
 // CHECK-NEXT: Input file: {{.*}}DependsOnModule.h
-// CHECK-NEXT: Input file: {{.*}}module.map
+// CHECK-NEXT: Input file: {{.*}}module.modulemap
 // CHECK-NEXT: Input file: {{.*}}other.h
 // CHECK-NEXT: Input file: {{.*}}not_cxx.h
 // CHECK-NEXT: Input file: {{.*}}not_coroutines.h

diff  --git a/clang/test/Modules/modulemap-locations.m b/clang/test/Modules/modulemap-locations.m
index e5738e105263ac..330a03d1fb6335 100644
--- a/clang/test/Modules/modulemap-locations.m
+++ b/clang/test/Modules/modulemap-locations.m
@@ -2,9 +2,13 @@
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/ModuleMapLocations/Module_ModuleMap -I %S/Inputs/ModuleMapLocations/Both -F %S/Inputs/ModuleMapLocations -I %S/Inputs/ModuleMapLocations -F %S/Inputs -x objective-c -fsyntax-only %s -verify -Wno-private-module
 
 // regular
+ at import module_map; // expected-warning@*{{as a module map name is deprecated, rename it to module.modulemap}}
+                    // expected-warning@*{{as a module map name is deprecated, rename it to module.private.modulemap}}
 @import module_modulemap;
 @import both;
 // framework
+ at import Module_Map_F; // expected-warning@*{{as a module map name is deprecated, rename it to module.modulemap in the 'Modules' directory of the framework}}
+ at import Module_Map_F; // expected-warning@*{{as a module map name is deprecated, rename it to module.private.modulemap in the 'Modules' directory of the framework}}
 @import Module_ModuleMap_F;
 @import Module_ModuleMap_F.Private;
 @import Both_F;

diff  --git a/clang/test/Modules/no-stale-modtime.m b/clang/test/Modules/no-stale-modtime.m
index c7ff21c22a9f56..92c18ac591addf 100644
--- a/clang/test/Modules/no-stale-modtime.m
+++ b/clang/test/Modules/no-stale-modtime.m
@@ -11,9 +11,9 @@
 // RUN: echo '// top' > %t/t.h-1
 // RUN: cat %t/t.h-1 > %t/t.h
 
-// RUN: echo 'module b { header "b.h" } module l { header "l.h" }' > %t/module.map-1
-// RUN: echo 'module r { header "r.h" } module t { header "t.h" }' > %t/module.map-2
-// RUN: cat %t/module.map-1 %t/module.map-2 > %t/module.map
+// RUN: echo 'module b { header "b.h" } module l { header "l.h" }' > %t/module.modulemap-1
+// RUN: echo 'module r { header "r.h" } module t { header "t.h" }' > %t/module.modulemap-2
+// RUN: cat %t/module.modulemap-1 %t/module.modulemap-2 > %t/module.modulemap
 
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
 // RUN:     -I %t -fsyntax-only %s -Rmodule-build 2>&1 \

diff  --git a/clang/test/Modules/objc-at-keyword.m b/clang/test/Modules/objc-at-keyword.m
index 0e058a309017a0..b4136cfecbd07f 100644
--- a/clang/test/Modules/objc-at-keyword.m
+++ b/clang/test/Modules/objc-at-keyword.m
@@ -1,6 +1,6 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -verify -x objective-c -fmodule-name=objcAtKeywordMissingEnd -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=Empty -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -verify -x objective-c -fmodule-name=objcAtKeywordMissingEnd -emit-module %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=Empty -emit-module %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -verify -I %S/Inputs %s
 
 @interface X // expected-note {{class started here}}

diff  --git a/clang/test/Modules/objc-categories.m b/clang/test/Modules/objc-categories.m
index 8bc73a29c51cb2..a2f331332c90fa 100644
--- a/clang/test/Modules/objc-categories.m
+++ b/clang/test/Modules/objc-categories.m
@@ -1,9 +1,9 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=category_top -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=category_left -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=category_right -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=category_bottom -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=category_other -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=category_top -emit-module %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=category_left -emit-module %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=category_right -emit-module %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=category_bottom -emit-module %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=category_other -emit-module %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify
 
 @import category_bottom;

diff  --git a/clang/test/Modules/objc-type-param.m b/clang/test/Modules/objc-type-param.m
index 3417d62b25ffb0..cf6008768cbe53 100644
--- a/clang/test/Modules/objc-type-param.m
+++ b/clang/test/Modules/objc-type-param.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=objc_type_param -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=objc_type_param -emit-module %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify
 
 @import objc_type_param;

diff  --git a/clang/test/Modules/objc_redef.m b/clang/test/Modules/objc_redef.m
index 2e57f41bc66247..b2a75140a76b84 100644
--- a/clang/test/Modules/objc_redef.m
+++ b/clang/test/Modules/objc_redef.m
@@ -6,8 +6,8 @@ int test(id x) {
 }
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=redeclarations_left %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=weird_objc %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=redeclarations_left %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=weird_objc %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify
 // expected-no-diagnostics
 

diff  --git a/clang/test/Modules/odr_hash-blocks.cpp b/clang/test/Modules/odr_hash-blocks.cpp
index 512c659f841e49..b1e62a1cf0b990 100644
--- a/clang/test/Modules/odr_hash-blocks.cpp
+++ b/clang/test/Modules/odr_hash-blocks.cpp
@@ -17,12 +17,12 @@
 // RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++11 -fblocks %t/Inputs/second.h
 
 // Build module map file
-// RUN: echo "module FirstModule {"     >> %t/Inputs/module.map
-// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
-// RUN: echo "module SecondModule {"    >> %t/Inputs/module.map
-// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
+// RUN: echo "module FirstModule {"     >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
+// RUN: echo "module SecondModule {"    >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
 
 // Run test
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps \

diff  --git a/clang/test/Modules/odr_hash-gnu.cpp b/clang/test/Modules/odr_hash-gnu.cpp
index f87b2b841f905f..a212118a39a8a9 100644
--- a/clang/test/Modules/odr_hash-gnu.cpp
+++ b/clang/test/Modules/odr_hash-gnu.cpp
@@ -17,12 +17,12 @@
 // RUN: %clang_cc1 -fsyntax-only -x c++ -std=gnu++11 %t/Inputs/second.h
 
 // Build module map file
-// RUN: echo "module FirstModule {"     >> %t/Inputs/module.map
-// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
-// RUN: echo "module SecondModule {"    >> %t/Inputs/module.map
-// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
+// RUN: echo "module FirstModule {"     >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
+// RUN: echo "module SecondModule {"    >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
 
 // Run test
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x c++ -I%t/Inputs -verify %s -std=gnu++11

diff  --git a/clang/test/Modules/odr_hash-vector.cpp b/clang/test/Modules/odr_hash-vector.cpp
index ee59cb617c1a67..e2da431a732556 100644
--- a/clang/test/Modules/odr_hash-vector.cpp
+++ b/clang/test/Modules/odr_hash-vector.cpp
@@ -17,12 +17,12 @@
 // RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++11 %t/Inputs/second.h -fzvector
 
 // Build module map file
-// RUN: echo "module FirstModule {"     >> %t/Inputs/module.map
-// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
-// RUN: echo "module SecondModule {"    >> %t/Inputs/module.map
-// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
+// RUN: echo "module FirstModule {"     >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
+// RUN: echo "module SecondModule {"    >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
 
 // Run test
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x c++ -I%t/Inputs -verify %s -std=c++11 -fzvector

diff  --git a/clang/test/Modules/odr_hash.cl b/clang/test/Modules/odr_hash.cl
index d4af1cea6e2654..474da6e62f1597 100644
--- a/clang/test/Modules/odr_hash.cl
+++ b/clang/test/Modules/odr_hash.cl
@@ -17,12 +17,12 @@
 // RUN: %clang_cc1 -fsyntax-only -x c++ %t/Inputs/second.h -cl-std=CL2.0
 
 // Build module map file
-// RUN: echo "module FirstModule {"     >> %t/Inputs/module.map
-// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
-// RUN: echo "module SecondModule {"    >> %t/Inputs/module.map
-// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
+// RUN: echo "module FirstModule {"     >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
+// RUN: echo "module SecondModule {"    >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
 
 // Run test
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x c++ -I%t/Inputs -verify %s -cl-std=CL2.0

diff  --git a/clang/test/Modules/odr_hash.cpp b/clang/test/Modules/odr_hash.cpp
index 7954a1f5f2e50b..220ef767df849a 100644
--- a/clang/test/Modules/odr_hash.cpp
+++ b/clang/test/Modules/odr_hash.cpp
@@ -17,12 +17,12 @@
 // RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++1z %t/Inputs/second.h
 
 // Build module map file
-// RUN: echo "module FirstModule {"     >> %t/Inputs/module.map
-// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
-// RUN: echo "module SecondModule {"    >> %t/Inputs/module.map
-// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
+// RUN: echo "module FirstModule {"     >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
+// RUN: echo "module SecondModule {"    >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
 
 // Run test
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -x c++ -std=c++1z \

diff  --git a/clang/test/Modules/odr_hash.mm b/clang/test/Modules/odr_hash.mm
index 9c6454a790edb8..512c8adc15924a 100644
--- a/clang/test/Modules/odr_hash.mm
+++ b/clang/test/Modules/odr_hash.mm
@@ -17,12 +17,12 @@
 // RUN: %clang_cc1 -fsyntax-only -x objective-c++ %t/Inputs/second.h -fblocks -fobjc-arc
 
 // Build module map file
-// RUN: echo "module FirstModule {"     >> %t/Inputs/module.map
-// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
-// RUN: echo "module SecondModule {"    >> %t/Inputs/module.map
-// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.map
-// RUN: echo "}"                        >> %t/Inputs/module.map
+// RUN: echo "module FirstModule {"     >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
+// RUN: echo "module SecondModule {"    >> %t/Inputs/module.modulemap
+// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.modulemap
+// RUN: echo "}"                        >> %t/Inputs/module.modulemap
 
 // Run test
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c++ -I%t/Inputs -verify %s -fblocks -fobjc-arc

diff  --git a/clang/test/Modules/pragma-pack.cpp b/clang/test/Modules/pragma-pack.cpp
index 96a880c6307b0d..8239cafd6907e4 100644
--- a/clang/test/Modules/pragma-pack.cpp
+++ b/clang/test/Modules/pragma-pack.cpp
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fmodules \
 // RUN:   -fimplicit-module-maps -x c++ -emit-module \
 // RUN:   -fmodules-cache-path=%t.cache \
-// RUN:   -fmodule-name=pragma_pack %S/Inputs/module.map
+// RUN:   -fmodule-name=pragma_pack %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fmodules \
 // RUN:   -fimplicit-module-maps -x c++ -verify \
 // RUN:   -fmodules-cache-path=%t.cache \
@@ -11,7 +11,7 @@
 // RUN:   -fmodules-local-submodule-visibility \
 // RUN:   -fimplicit-module-maps -x c++ -emit-module \
 // RUN:   -fmodules-cache-path=%tlocal.cache \
-// RUN:   -fmodule-name=pragma_pack %S/Inputs/module.map
+// RUN:   -fmodule-name=pragma_pack %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fmodules \
 // RUN:   -fmodules-local-submodule-visibility \
 // RUN:   -fimplicit-module-maps -x c++ -verify \

diff  --git a/clang/test/Modules/recursive.c b/clang/test/Modules/recursive.c
index 9c03a6ac4548b0..efb21320f77685 100644
--- a/clang/test/Modules/recursive.c
+++ b/clang/test/Modules/recursive.c
@@ -3,7 +3,7 @@
 #include "recursive1.h"
 
 // RUN: rm -rf %t
-// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=recursive1 %S/Inputs/module.map 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=recursive1 %S/Inputs/module.modulemap 2>&1 | FileCheck %s
 
 // CHECK:      While building module 'recursive1'{{( imported from .*[/\]recursive.c:3)?}}:
 // CHECK-NEXT: While building module 'recursive2' imported from {{.*Inputs[/\]}}recursive1.h:1:

diff  --git a/clang/test/Modules/redecl-namespaces.mm b/clang/test/Modules/redecl-namespaces.mm
index e17af86feba816..9732b31f2b92d2 100644
--- a/clang/test/Modules/redecl-namespaces.mm
+++ b/clang/test/Modules/redecl-namespaces.mm
@@ -8,6 +8,6 @@ void test() {
 }
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -emit-module -fmodule-name=redecl_namespaces_left %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -emit-module -fmodule-name=redecl_namespaces_right %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -emit-module -fmodule-name=redecl_namespaces_left %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -emit-module -fmodule-name=redecl_namespaces_right %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -w %s -verify

diff  --git a/clang/test/Modules/redeclarations.m b/clang/test/Modules/redeclarations.m
index e3f78f28d75c50..dacc84c6df469a 100644
--- a/clang/test/Modules/redeclarations.m
+++ b/clang/test/Modules/redeclarations.m
@@ -5,8 +5,8 @@ @interface MyObject : NSObject
 @end
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=redeclarations_left %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=redeclarations_right %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=redeclarations_left %S/Inputs/module.modulemap
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=redeclarations_right %S/Inputs/module.modulemap
 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify
 // expected-no-diagnostics
 

diff  --git a/clang/test/Modules/relative-submodule-topheader.m b/clang/test/Modules/relative-submodule-topheader.m
index c7c2f130768664..ec973a9c96893d 100644
--- a/clang/test/Modules/relative-submodule-topheader.m
+++ b/clang/test/Modules/relative-submodule-topheader.m
@@ -1,5 +1,5 @@
 // RUN: cd %S
-// RUN: %clang_cc1 -fmodules -fno-implicit-modules -x objective-c++ -fmodule-name=std -emit-module Inputs/submodules/module.map -o %t/mod.pcm
+// RUN: %clang_cc1 -fmodules -fno-implicit-modules -x objective-c++ -fmodule-name=std -emit-module Inputs/submodules/module.modulemap -o %t/mod.pcm
 // RUN: llvm-bcanalyzer --dump --disable-histogram %t/mod.pcm | FileCheck %s
 
 // CHECK: <SUBMODULE_HEADER abbrevid=6/> blob data = 'vector.h'

diff  --git a/clang/test/Modules/requires-coroutines.mm b/clang/test/Modules/requires-coroutines.mm
index 21b8b8b097e915..c432c579fe5f2a 100644
--- a/clang/test/Modules/requires-coroutines.mm
+++ b/clang/test/Modules/requires-coroutines.mm
@@ -2,5 +2,5 @@
 // RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -Wno-private-module -F %S/Inputs -I %S/Inputs/DependsOnModule.framework %s -verify
 
 @import DependsOnModule.NotCoroutines;
-// expected-error at module.map:25 {{module 'DependsOnModule.Coroutines' requires feature 'coroutines'}}
+// expected-error at Modules/module.modulemap:25 {{module 'DependsOnModule.Coroutines' requires feature 'coroutines'}}
 @import DependsOnModule.Coroutines; // expected-note {{module imported here}}

diff  --git a/clang/test/Modules/requires-gnuinlineasm.m b/clang/test/Modules/requires-gnuinlineasm.m
index e710b6bf8d4b50..e1900b14510794 100644
--- a/clang/test/Modules/requires-gnuinlineasm.m
+++ b/clang/test/Modules/requires-gnuinlineasm.m
@@ -9,7 +9,7 @@
 // RUN:     -DASM_INLINE -verify
 
 #ifdef NO_ASM_INLINE
-// expected-error at NeedsGNUInlineAsm.framework/module.map:4 {{module 'NeedsGNUInlineAsm.Asm' requires feature 'gnuinlineasm'}}
+// expected-error at NeedsGNUInlineAsm.framework/Modules/module.modulemap:4 {{module 'NeedsGNUInlineAsm.Asm' requires feature 'gnuinlineasm'}}
 @import NeedsGNUInlineAsm.Asm; // expected-note {{module imported here}}
 #endif
 

diff  --git a/clang/test/Modules/requires.m b/clang/test/Modules/requires.m
index 77f00a0e47c182..a47ea2b4bd0c90 100644
--- a/clang/test/Modules/requires.m
+++ b/clang/test/Modules/requires.m
@@ -2,39 +2,39 @@
 // RUN: %clang_cc1 -Rmodule-include-translation -Wno-private-module -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -I %S/Inputs %s -verify -fmodule-feature custom_req1
 // RUN: %clang_cc1 -Rmodule-include-translation -Wno-private-module -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -I %S/Inputs %s -verify -std=c89 -DTEST_C_FEATURES
 #ifndef TEST_C_FEATURES
-// expected-error at DependsOnModule.framework/module.map:7 {{module 'DependsOnModule.CXX' requires feature 'cplusplus'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:7 {{module 'DependsOnModule.CXX' requires feature 'cplusplus'}}
 @import DependsOnModule.CXX; // expected-note {{module imported here}}
 @import DependsOnModule.NotCXX;
-// expected-error at DependsOnModule.framework/module.map:15 {{module 'DependsOnModule.NotObjC' is incompatible with feature 'objc'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:15 {{module 'DependsOnModule.NotObjC' is incompatible with feature 'objc'}}
 @import DependsOnModule.NotObjC; // expected-note {{module imported here}}
 @import DependsOnModule.CustomReq1; // OK
-// expected-error at DependsOnModule.framework/module.map:22 {{module 'DependsOnModule.CustomReq2' requires feature 'custom_req2'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:22 {{module 'DependsOnModule.CustomReq2' requires feature 'custom_req2'}}
 @import DependsOnModule.CustomReq2; // expected-note {{module imported here}}
 
 @import RequiresWithMissingHeader; // OK
-// expected-error at module.map:* {{module 'RequiresWithMissingHeader.HeaderBefore' requires feature 'missing'}}
+// expected-error at module.modulemap:* {{module 'RequiresWithMissingHeader.HeaderBefore' requires feature 'missing'}}
 @import RequiresWithMissingHeader.HeaderBefore; // expected-note {{module imported here}}
-// expected-error at module.map:* {{module 'RequiresWithMissingHeader.HeaderAfter' requires feature 'missing'}}
+// expected-error at module.modulemap:* {{module 'RequiresWithMissingHeader.HeaderAfter' requires feature 'missing'}}
 @import RequiresWithMissingHeader.HeaderAfter; // expected-note {{module imported here}}
-// expected-error at DependsOnModule.framework/module.map:40 {{module 'DependsOnModule.CXX11' requires feature 'cplusplus11'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:40 {{module 'DependsOnModule.CXX11' requires feature 'cplusplus11'}}
 @import DependsOnModule.CXX11; // expected-note {{module imported here}}
-// expected-error at DependsOnModule.framework/module.map:43 {{module 'DependsOnModule.CXX14' requires feature 'cplusplus14'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:43 {{module 'DependsOnModule.CXX14' requires feature 'cplusplus14'}}
 @import DependsOnModule.CXX14; // expected-note {{module imported here}}
-// expected-error at DependsOnModule.framework/module.map:46 {{module 'DependsOnModule.CXX17' requires feature 'cplusplus17'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:46 {{module 'DependsOnModule.CXX17' requires feature 'cplusplus17'}}
 @import DependsOnModule.CXX17; // expected-note {{module imported here}}
-// expected-error at DependsOnModule.framework/module.map:49 {{module 'DependsOnModule.CXX20' requires feature 'cplusplus20'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:49 {{module 'DependsOnModule.CXX20' requires feature 'cplusplus20'}}
 @import DependsOnModule.CXX20; // expected-note {{module imported here}}
-// expected-error at DependsOnModule.framework/module.map:52 {{module 'DependsOnModule.CXX23' requires feature 'cplusplus23'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:52 {{module 'DependsOnModule.CXX23' requires feature 'cplusplus23'}}
 @import DependsOnModule.CXX23; // expected-note {{module imported here}}
-// expected-error at DependsOnModule.framework/module.map:55 {{module 'DependsOnModule.CXX26' requires feature 'cplusplus26'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:55 {{module 'DependsOnModule.CXX26' requires feature 'cplusplus26'}}
 @import DependsOnModule.CXX26; // expected-note {{module imported here}}
 #else
-// expected-error at DependsOnModule.framework/module.map:58 {{module 'DependsOnModule.C99' requires feature 'c99'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:58 {{module 'DependsOnModule.C99' requires feature 'c99'}}
 @import DependsOnModule.C99; // expected-note {{module imported here}}
-// expected-error at DependsOnModule.framework/module.map:61 {{module 'DependsOnModule.C11' requires feature 'c11'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:61 {{module 'DependsOnModule.C11' requires feature 'c11'}}
 @import DependsOnModule.C11; // expected-note {{module imported here}}
-// expected-error at DependsOnModule.framework/module.map:64 {{module 'DependsOnModule.C17' requires feature 'c17'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:64 {{module 'DependsOnModule.C17' requires feature 'c17'}}
 @import DependsOnModule.C17; // expected-note {{module imported here}}
-// expected-error at DependsOnModule.framework/module.map:67 {{module 'DependsOnModule.C23' requires feature 'c23'}}
+// expected-error at DependsOnModule.framework/Modules/module.modulemap:67 {{module 'DependsOnModule.C23' requires feature 'c23'}}
 @import DependsOnModule.C23; // expected-note {{module imported here}}
 #endif

diff  --git a/clang/test/Modules/requires.mm b/clang/test/Modules/requires.mm
index 4b11fcb33e1b90..943823994eeb29 100644
--- a/clang/test/Modules/requires.mm
+++ b/clang/test/Modules/requires.mm
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -Rmodule-include-translation -Wno-private-module -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -I %S/Inputs/DependsOnModule.framework %s -verify
 
 @import DependsOnModule.CXX;
-// expected-error at module.map:11 {{module 'DependsOnModule.NotCXX' is incompatible with feature 'cplusplus'}}
+// expected-error at Modules/module.modulemap:11 {{module 'DependsOnModule.NotCXX' is incompatible with feature 'cplusplus'}}
 @import DependsOnModule.NotCXX; // expected-note {{module imported here}}
-// expected-error at module.map:15 {{module 'DependsOnModule.NotObjC' is incompatible with feature 'objc'}}
+// expected-error at Modules/module.modulemap:15 {{module 'DependsOnModule.NotObjC' is incompatible with feature 'objc'}}
 @import DependsOnModule.NotObjC; // expected-note {{module imported here}}

diff  --git a/clang/test/Modules/target-platform-features.m b/clang/test/Modules/target-platform-features.m
index 875c83a2a545bf..08fad5b4432aff 100644
--- a/clang/test/Modules/target-platform-features.m
+++ b/clang/test/Modules/target-platform-features.m
@@ -4,17 +4,17 @@
 // RUN: mkdir %t/cache
 // RUN: mkdir %t/InputsA
 
-// RUN: echo "module RequiresMacOS {"       >> %t/InputsA/module.map
-// RUN: echo "  requires macos"             >> %t/InputsA/module.map
-// RUN: echo "}"                            >> %t/InputsA/module.map
-// RUN: echo "module RequiresNotiOS {"      >> %t/InputsA/module.map
-// RUN: echo "  requires !ios"              >> %t/InputsA/module.map
-// RUN: echo "}"                            >> %t/InputsA/module.map
-// RUN: echo "module RequiresMain {"        >> %t/InputsA/module.map
-// RUN: echo "  module SubRequiresNotiOS {" >> %t/InputsA/module.map
-// RUN: echo "    requires !ios"            >> %t/InputsA/module.map
-// RUN: echo "  }"                          >> %t/InputsA/module.map
-// RUN: echo "}"                            >> %t/InputsA/module.map
+// RUN: echo "module RequiresMacOS {"       >> %t/InputsA/module.modulemap
+// RUN: echo "  requires macos"             >> %t/InputsA/module.modulemap
+// RUN: echo "}"                            >> %t/InputsA/module.modulemap
+// RUN: echo "module RequiresNotiOS {"      >> %t/InputsA/module.modulemap
+// RUN: echo "  requires !ios"              >> %t/InputsA/module.modulemap
+// RUN: echo "}"                            >> %t/InputsA/module.modulemap
+// RUN: echo "module RequiresMain {"        >> %t/InputsA/module.modulemap
+// RUN: echo "  module SubRequiresNotiOS {" >> %t/InputsA/module.modulemap
+// RUN: echo "    requires !ios"            >> %t/InputsA/module.modulemap
+// RUN: echo "  }"                          >> %t/InputsA/module.modulemap
+// RUN: echo "}"                            >> %t/InputsA/module.modulemap
 
 // RUN: %clang_cc1 -triple=x86_64-apple-macosx10.6 -DENABLE_DARWIN -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsA -verify %s 
 // expected-no-diagnostics
@@ -32,9 +32,9 @@
 #endif
 
 // RUN: mkdir %t/InputsB
-// RUN: echo "module RequiresiOSSim {"     >> %t/InputsB/module.map
-// RUN: echo "  requires iossimulator"      >> %t/InputsB/module.map
-// RUN: echo "}"                            >> %t/InputsB/module.map
+// RUN: echo "module RequiresiOSSim {"     >> %t/InputsB/module.modulemap
+// RUN: echo "  requires iossimulator"      >> %t/InputsB/module.modulemap
+// RUN: echo "}"                            >> %t/InputsB/module.modulemap
 // RUN: %clang_cc1 -triple=x86_64-apple-iossimulator -DENABLE_IOSSIM -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsB %s  -verify
 // RUN: %clang_cc1 -triple=x86_64-apple-ios-simulator -DENABLE_IOSSIM -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsB %s  -verify
 
@@ -43,15 +43,15 @@
 #endif
 
 // RUN: mkdir %t/InputsC
-// RUN: echo "module RequiresLinuxEABIA {"  >> %t/InputsC/module.map
-// RUN: echo "  requires linux, gnueabi"    >> %t/InputsC/module.map
-// RUN: echo "}"                            >> %t/InputsC/module.map
-// RUN: echo "module RequiresLinuxEABIB {"  >> %t/InputsC/module.map
-// RUN: echo "  requires gnueabi"           >> %t/InputsC/module.map
-// RUN: echo "}"                            >> %t/InputsC/module.map
-// RUN: echo "module RequiresLinuxEABIC {"  >> %t/InputsC/module.map
-// RUN: echo "  requires linux"             >> %t/InputsC/module.map
-// RUN: echo "}"                            >> %t/InputsC/module.map
+// RUN: echo "module RequiresLinuxEABIA {"  >> %t/InputsC/module.modulemap
+// RUN: echo "  requires linux, gnueabi"    >> %t/InputsC/module.modulemap
+// RUN: echo "}"                            >> %t/InputsC/module.modulemap
+// RUN: echo "module RequiresLinuxEABIB {"  >> %t/InputsC/module.modulemap
+// RUN: echo "  requires gnueabi"           >> %t/InputsC/module.modulemap
+// RUN: echo "}"                            >> %t/InputsC/module.modulemap
+// RUN: echo "module RequiresLinuxEABIC {"  >> %t/InputsC/module.modulemap
+// RUN: echo "  requires linux"             >> %t/InputsC/module.modulemap
+// RUN: echo "}"                            >> %t/InputsC/module.modulemap
 // RUN: %clang_cc1 -triple=armv8r-none-linux-gnueabi -DENABLE_LINUXEABI -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsC %s -verify
 
 #ifdef ENABLE_LINUXEABI
@@ -61,15 +61,15 @@
 #endif
 
 // RUN: mkdir %t/InputsD
-// RUN: echo "module RequiresWinMSVCA {"  >> %t/InputsD/module.map
-// RUN: echo "  requires windows"         >> %t/InputsD/module.map
-// RUN: echo "}"                          >> %t/InputsD/module.map
-// RUN: echo "module RequiresWinMSVCB {"  >> %t/InputsD/module.map
-// RUN: echo "  requires windows, msvc"   >> %t/InputsD/module.map
-// RUN: echo "}"                          >> %t/InputsD/module.map
-// RUN: echo "module RequiresWinMSVCC {"  >> %t/InputsD/module.map
-// RUN: echo "  requires msvc"            >> %t/InputsD/module.map
-// RUN: echo "}"                          >> %t/InputsD/module.map
+// RUN: echo "module RequiresWinMSVCA {"  >> %t/InputsD/module.modulemap
+// RUN: echo "  requires windows"         >> %t/InputsD/module.modulemap
+// RUN: echo "}"                          >> %t/InputsD/module.modulemap
+// RUN: echo "module RequiresWinMSVCB {"  >> %t/InputsD/module.modulemap
+// RUN: echo "  requires windows, msvc"   >> %t/InputsD/module.modulemap
+// RUN: echo "}"                          >> %t/InputsD/module.modulemap
+// RUN: echo "module RequiresWinMSVCC {"  >> %t/InputsD/module.modulemap
+// RUN: echo "  requires msvc"            >> %t/InputsD/module.modulemap
+// RUN: echo "}"                          >> %t/InputsD/module.modulemap
 // RUN: %clang_cc1 -triple=thumbv7-unknown-windows-msvc -DENABLE_WINMSVC -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsD %s  -verify
 
 #ifdef ENABLE_WINMSVC

diff  --git a/clang/test/Modules/timestamps.c b/clang/test/Modules/timestamps.c
index 5315750b81590c..50fdce63025508 100644
--- a/clang/test/Modules/timestamps.c
+++ b/clang/test/Modules/timestamps.c
@@ -20,7 +20,7 @@
 // CHECK-NEXT: <INPUT_FILE abbrevid=4 op0=1 op1=[[#]]
 // TIMESTAMP-NOT: op2=0
 // NOTIMESTAMP: op2=0
-// CHECK-SAME: blob data = 'module.map'
+// CHECK-SAME: blob data = 'module.modulemap'
 // CHECK-NEXT: <INPUT_FILE_HASH abbrevid=[[#]] op0=[[#]] op1=[[#]]/>
 // CHECK-NEXT: <INPUT_FILE abbrevid=4 op0=2 op1=[[#]]
 // TIMESTAMP-NOT: op2=0

diff  --git a/clang/test/Modules/validate-system-headers.m b/clang/test/Modules/validate-system-headers.m
index cceedb2daacb40..7599d4ed5914ef 100644
--- a/clang/test/Modules/validate-system-headers.m
+++ b/clang/test/Modules/validate-system-headers.m
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t/ModuleCache
 // RUN: mkdir -p %t/Inputs/usr/include
 // RUN: touch %t/Inputs/usr/include/foo.h
-// RUN: echo 'module Foo [system] { header "foo.h" }' > %t/Inputs/usr/include/module.map
+// RUN: echo 'module Foo [system] { header "foo.h" }' > %t/Inputs/usr/include/module.modulemap
 
 ////
 // Build a module using a system header

diff  --git a/clang/test/PCH/modified-module-dependency.m b/clang/test/PCH/modified-module-dependency.m
index 39fddb039bad62..44c14b3a0231ca 100644
--- a/clang/test/PCH/modified-module-dependency.m
+++ b/clang/test/PCH/modified-module-dependency.m
@@ -2,7 +2,7 @@
 // RUN: mkdir -p %t-dir
 // RUN: echo '@import test;' > %t-dir/prefix.h
 // RUN: echo 'void foo(void);' > %t-dir/test.h
-// RUN: cp %S/modified-module-dependency.module.map %t-dir/module.map
+// RUN: cp %S/modified-module-dependency.module.map %t-dir/module.modulemap
 
 // Precompile prefix.pch.
 // RUN: %clang_cc1 -x objective-c -I %t-dir -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-dir/cache -fdisable-module-hash -emit-pch %t-dir/prefix.h -o %t-dir/prefix.pch

diff  --git a/clang/test/Preprocessor/pragma_module.c b/clang/test/Preprocessor/pragma_module.c
index c52d42537573f6..2d86b989411fd7 100644
--- a/clang/test/Preprocessor/pragma_module.c
+++ b/clang/test/Preprocessor/pragma_module.c
@@ -1,9 +1,9 @@
 // RUN: rm -rf %t
 // RUN: mkdir %t
-// RUN: echo 'module foo { module a {} module b {} } module bar {} module if {}' > %t/module.map
-// RUN: %clang_cc1 -fmodules -fmodule-name=if -x c %t/module.map -emit-module -o %t/if.pcm
-// RUN: %clang_cc1 -E -fmodules %s -fmodule-file=%t/if.pcm -verify -fmodule-name=foo -fmodule-map-file=%t/module.map
-// RUN: %clang_cc1 -E -fmodules %s -fmodule-file=%t/if.pcm -verify -fmodule-name=foo -fmodule-map-file=%t/module.map -fmodules-local-submodule-visibility -DLOCAL_VIS
+// RUN: echo 'module foo { module a {} module b {} } module bar {} module if {}' > %t/module.modulemap
+// RUN: %clang_cc1 -fmodules -fmodule-name=if -x c %t/module.modulemap -emit-module -o %t/if.pcm
+// RUN: %clang_cc1 -E -fmodules %s -fmodule-file=%t/if.pcm -verify -fmodule-name=foo -fmodule-map-file=%t/module.modulemap
+// RUN: %clang_cc1 -E -fmodules %s -fmodule-file=%t/if.pcm -verify -fmodule-name=foo -fmodule-map-file=%t/module.modulemap -fmodules-local-submodule-visibility -DLOCAL_VIS
 
 // Just checking the syntax here; the semantics are tested elsewhere.
 #pragma clang module import // expected-error {{expected module name}}

diff  --git a/clang/test/SemaObjC/Inputs/module.map b/clang/test/SemaObjC/Inputs/module.modulemap
similarity index 100%
rename from clang/test/SemaObjC/Inputs/module.map
rename to clang/test/SemaObjC/Inputs/module.modulemap

diff  --git a/clang/test/VFS/Inputs/vfsoverlay.yaml b/clang/test/VFS/Inputs/vfsoverlay.yaml
index 504a1530d3c553..25ac53ea0ac77a 100644
--- a/clang/test/VFS/Inputs/vfsoverlay.yaml
+++ b/clang/test/VFS/Inputs/vfsoverlay.yaml
@@ -9,7 +9,7 @@
         { 'name': 'import_some_frame.h', 'type': 'file',
           'external-contents': 'INPUT_DIR/import_some_frame.h'
         },
-        { 'name': 'module.map', 'type': 'file',
+        { 'name': 'module.modulemap', 'type': 'file',
           'external-contents': 'INPUT_DIR/actual_module.map'
         },
         { 'name': 'include_real.h', 'type': 'file',

diff  --git a/clang/test/VFS/Inputs/vfsoverlay2.yaml b/clang/test/VFS/Inputs/vfsoverlay2.yaml
index ae2a0ce4ec98ff..f6ed2710941bdd 100644
--- a/clang/test/VFS/Inputs/vfsoverlay2.yaml
+++ b/clang/test/VFS/Inputs/vfsoverlay2.yaml
@@ -3,7 +3,7 @@
   'roots': [
     { 'name': 'OUT_DIR', 'type': 'directory',
       'contents': [
-        { 'name': 'module.map', 'type': 'file',
+        { 'name': 'module.modulemap', 'type': 'file',
           'external-contents': 'INPUT_DIR/actual_module2.map'
         }
       ]

diff  --git a/clang/test/VFS/test_nonmodular.c b/clang/test/VFS/test_nonmodular.c
index faec0e3a516235..c7acb74f5eca2f 100644
--- a/clang/test/VFS/test_nonmodular.c
+++ b/clang/test/VFS/test_nonmodular.c
@@ -1,6 +1,6 @@
 // RUN: rm -rf %t
 // RUN: mkdir -p %t/vdir %t/cache %t/outdir
-// We can't have module.map inside Inputs/Nonmodular.
+// We can't have module.modulemap inside Inputs/Nonmodular.
 // RUN: cp %S/Inputs/Nonmodular/Nonmodular.modulemap %t/outdir/module.modulemap
 //
 // RUN: sed -e "s at VDIR@%{/t:regex_replacement}/vdir at g" -e "s at IN_DIR@%{/S:regex_replacement}@g" -e "s at OUT_DIR@%{/t:regex_replacement}/outdir at g" %S/Inputs/Nonmodular/nonmodular-headers.yaml > %t/vdir/nonmodular-headers.yaml

diff  --git a/clang/unittests/Tooling/ToolingTest.cpp b/clang/unittests/Tooling/ToolingTest.cpp
index 354af292a54108..2e3da2cd2a7013 100644
--- a/clang/unittests/Tooling/ToolingTest.cpp
+++ b/clang/unittests/Tooling/ToolingTest.cpp
@@ -197,8 +197,8 @@ TEST(ToolInvocation, TestMapVirtualFile) {
 
 TEST(ToolInvocation, TestVirtualModulesCompilation) {
   // FIXME: Currently, this only tests that we don't exit with an error if a
-  // mapped module.map is found on the include path. In the future, expand this
-  // test to run a full modules enabled compilation, so we make sure we can
+  // mapped module.modulemap is found on the include path. In the future, expand
+  // this test to run a full modules enabled compilation, so we make sure we can
   // rerun modules compilations with a virtual file system.
   llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFileSystem(
       new llvm::vfs::OverlayFileSystem(llvm::vfs::getRealFileSystem()));
@@ -218,9 +218,9 @@ TEST(ToolInvocation, TestVirtualModulesCompilation) {
       "test.cpp", 0, llvm::MemoryBuffer::getMemBuffer("#include <abc>\n"));
   InMemoryFileSystem->addFile("def/abc", 0,
                               llvm::MemoryBuffer::getMemBuffer("\n"));
-  // Add a module.map file in the include directory of our header, so we trigger
-  // the module.map header search logic.
-  InMemoryFileSystem->addFile("def/module.map", 0,
+  // Add a module.modulemap file in the include directory of our header, so we
+  // trigger the module.modulemap header search logic.
+  InMemoryFileSystem->addFile("def/module.modulemap", 0,
                               llvm::MemoryBuffer::getMemBuffer("\n"));
   EXPECT_TRUE(Invocation.run());
 }


        


More information about the cfe-commits mailing list