PR21215: Support -fmodule-map-file being specified multiple times. Support
loading multiple module map files from the same directory.
llvm-svn: 220020
diff --git a/clang/test/Driver/modules.m b/clang/test/Driver/modules.m
index fbd41d8..dafb934 100644
--- a/clang/test/Driver/modules.m
+++ b/clang/test/Driver/modules.m
@@ -33,3 +33,8 @@
// RUN: %clang -fmodules-validate-system-headers -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS %s
// MODULES_VALIDATE_SYSTEM_HEADERS: -fmodules-validate-system-headers
+
+// RUN: %clang -fmodules -fmodule-map-file=foo.map -fmodule-map-file=bar.map -### %s 2>&1 | FileCheck -check-prefix=CHECK-MODULE-MAP-FILES %s
+// CHECK-MODULE-MAP-FILES: "-fmodules"
+// CHECK-MODULE-MAP-FILES: "-fmodule-map-file=" "foo.map"
+// CHECK-MODULE-MAP-FILES: "-fmodule-map-file=" "bar.map"
diff --git a/clang/test/Modules/Inputs/modular_maps/c.h b/clang/test/Modules/Inputs/modular_maps/c.h
new file mode 100644
index 0000000..6e3468e
--- /dev/null
+++ b/clang/test/Modules/Inputs/modular_maps/c.h
@@ -0,0 +1,4 @@
+#ifndef C_H
+#define C_H
+const int c = 5;
+#endif
diff --git a/clang/test/Modules/Inputs/modular_maps/common.h b/clang/test/Modules/Inputs/modular_maps/common.h
index f690bcb..349bf5f 100644
--- a/clang/test/Modules/Inputs/modular_maps/common.h
+++ b/clang/test/Modules/Inputs/modular_maps/common.h
@@ -1,4 +1,4 @@
#ifndef COMMON_H
#define COMMON_H
-const int c = 2;
+const int x = 2;
#endif
diff --git a/clang/test/Modules/Inputs/modular_maps/modulec.map b/clang/test/Modules/Inputs/modular_maps/modulec.map
new file mode 100644
index 0000000..c5a1ffe
--- /dev/null
+++ b/clang/test/Modules/Inputs/modular_maps/modulec.map
@@ -0,0 +1,3 @@
+module C {
+ header "c.h"
+}
diff --git a/clang/test/Modules/modular_maps.cpp b/clang/test/Modules/modular_maps.cpp
index 9c9aba8..484e727 100644
--- a/clang/test/Modules/modular_maps.cpp
+++ b/clang/test/Modules/modular_maps.cpp
@@ -1,8 +1,10 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fmodule-map-file=%S/Inputs/modular_maps/modulea.map -I %S/Inputs/modular_maps %s -verify
+// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fmodule-map-file=%S/Inputs/modular_maps/modulea.map -fmodule-map-file=%S/Inputs/modular_maps/modulec.map -I %S/Inputs/modular_maps %s -verify
+// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fmodule-map-file=%S/Inputs/modular_maps/modulec.map -fmodule-map-file=%S/Inputs/modular_maps/modulea.map -I %S/Inputs/modular_maps %s -verify
#include "common.h"
#include "a.h"
#include "b.h" // expected-error {{private header}}
-const int v = a + c;
-const int val = a + b + c; // expected-error {{undeclared identifier}}
+@import C;
+const int v = a + c + x;
+const int val = a + b + c + x; // expected-error {{undeclared identifier}}