When suggesting a module import for a #include or #import, suggest the
most specific (sub)module based on the actual file we find, rather
than always importing the top-level module. This means
that #include'ing <Foo/Blah.h> should give us the submodule Foo.Blah.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145942 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Modules/auto-module-import.c b/test/Modules/auto-module-import.c
index 51e9ee2..783b53d 100644
--- a/test/Modules/auto-module-import.c
+++ b/test/Modules/auto-module-import.c
@@ -18,3 +18,14 @@
 Module *mod2;
 
 int getDependsOther() { return depends_on_module_other; }
+
+void testSubframeworkOther() {
+  double *sfo1 = sub_framework_other; // expected-error{{use of undeclared identifier 'sub_framework_other'}}
+}
+
+// Test header cross-subframework include pattern.
+#include <DependsOnModule/../Frameworks/SubFramework.framework/Headers/Other.h> // expected-warning{{treating #include as an import of module 'DependsOnModule.SubFramework'}}
+
+void testSubframeworkOtherAgain() {
+  double *sfo1 = sub_framework_other;
+}