Implement merging of namespace-scope declarations across modules, so
that we can merge, for example, two occurrences of

  namespace N { void f(); }

in two disjoint modules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147780 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Modules/namespaces.cpp b/test/Modules/namespaces.cpp
index e1a8d6e..9ef966a 100644
--- a/test/Modules/namespaces.cpp
+++ b/test/Modules/namespaces.cpp
@@ -5,6 +5,8 @@
   char &f(char);
 }
 
+namespace N8 { }
+
 @import namespaces_left;
 @import namespaces_right;
 
@@ -23,6 +25,10 @@
   char &f(char);
 }
 
+namespace N10 { 
+  int &f(int);
+}
+
 void testMerged() {
   int &ir1 = N5::f(17);
   int &ir2 = N6::f(17);
@@ -34,3 +40,10 @@
   char &cr2 = N6::f('b');
 }
 
+// Test merging of declarations within namespaces that themselves were
+// merged without a common first declaration.
+void testMergedMerged() {
+  int &ir1 = N8::f(17);
+  int &ir2 = N9::f(17);
+  int &ir3 = N10::f(17);
+}