[HeaderSearch] loadSubdirectoryModuleMaps should respect -working-directory

Include search paths can be relative paths. The loadSubdirectoryModuleMaps function
should account for that and respect the -working-directory parameter given to Clang.

rdar://46045849

Differential Revision: https://reviews.llvm.org/D54503 

llvm-svn: 346822
diff --git a/clang/test/Modules/subdirectory-module-maps-working-dir.m b/clang/test/Modules/subdirectory-module-maps-working-dir.m
new file mode 100644
index 0000000..c106dd4
--- /dev/null
+++ b/clang/test/Modules/subdirectory-module-maps-working-dir.m
@@ -0,0 +1,13 @@
+// RUN: rm -rf %t
+// RUN: %clang -fsyntax-only -fmodules -fmodules-cache-path=%t \
+// RUN:    -working-directory %S/Inputs \
+// RUN:    -I subdirectory-module-maps-working-dir \
+// RUN:    %s -Werror=implicit-function-declaration -Xclang -verify
+
+@import ModuleInSubdir;
+
+void foo() {
+  int x = bar();
+}
+
+// expected-no-diagnostics