add PCH support for a bunch of C++ Decls, patch by
Andrew Sutton!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103301 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/PCH/Inputs/namespaces.h b/test/PCH/Inputs/namespaces.h
index 1bab746..553aadd 100644
--- a/test/PCH/Inputs/namespaces.h
+++ b/test/PCH/Inputs/namespaces.h
@@ -6,8 +6,35 @@
 
 namespace N1 {
   typedef int t2;
+
+  void used_func();
+
+  struct used_cls { };
 }
 
 namespace N2 {
   typedef float t1;
+
+  namespace Inner {
+    typedef int t3;
+  };
+}
+
+namespace {
+  void anon() { }
+  class C;
+}
+
+namespace N3 {
+  namespace {
+    class C;
+  }
+}
+
+namespace Alias1 = N2::Inner;
+
+using namespace N2::Inner;
+
+extern "C" {
+  void ext();
 }
diff --git a/test/PCH/namespaces.cpp b/test/PCH/namespaces.cpp
index eef9e06..532d627 100644
--- a/test/PCH/namespaces.cpp
+++ b/test/PCH/namespaces.cpp
@@ -8,7 +8,36 @@
 int int_val;
 N1::t1 *ip1 = &int_val;
 N1::t2 *ip2 = &int_val;
+N2::Inner::t3 *ip3 = &int_val;
 
 float float_val;
 namespace N2 { }
 N2::t1 *fp1 = &float_val;
+
+Alias1::t3 *ip4 = &int_val;
+t3 *ip5 = &int_val;
+
+void(*funp1)() = anon;
+
+namespace {
+  class C;
+}
+C* cp1;
+
+namespace N3 {
+  namespace {
+    class C;
+  }
+}
+
+N3::C *cp2;
+
+void(*funp2)() = ext;
+
+using N1::used_func;
+void (*pused)() = used_func;
+
+// FIXME: Disabled until CXXRecord serialization is re-added.
+// using N1::used_cls;
+// used_cls s1;
+// used_cls* ps1 = &s1;
diff --git a/test/SemaCXX/namespace-alias.cpp b/test/SemaCXX/namespace-alias.cpp
index 1c3da3c..52cae2e 100644
--- a/test/SemaCXX/namespace-alias.cpp
+++ b/test/SemaCXX/namespace-alias.cpp
@@ -84,6 +84,26 @@
   }
 }
 
+namespace {
+  class C1;
+}
+namespace {
+  class C1;
+}
+C1 *pc1 = 0;
+
+namespace N {
+  namespace {
+    class C2;
+  }
+}
+namespace N {
+  namespace {
+    class C2;
+  }
+}
+N::C2 *pc2 = 0;
+
 // PR6341
 namespace A = N;
 namespace N { }