When loading a module that involves submodules (e.g., std.vector),
check whether the named submodules themselves are actually
valid, and drill down to the named submodule (although we don't do
anything with it yet). Perform typo correction on the submodule names
when possible.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145477 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Modules/submodules.cpp b/test/Modules/submodules.cpp
new file mode 100644
index 0000000..6d541f6
--- /dev/null
+++ b/test/Modules/submodules.cpp
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/submodules %s -verify
+
+__import_module__ std.vector;
+__import_module__ std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
+__import_module__ std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}