Implement declaration merging for Objective-C protocols across
multiple, disjoint modules. There is far too much duplicating with the
ObjCInterfaceDecl case here, which I'll eliminate shortly.

llvm-svn: 147417
diff --git a/clang/test/Modules/Inputs/redecl-merge-bottom.h b/clang/test/Modules/Inputs/redecl-merge-bottom.h
index b3cc74b..26a1ba5 100644
--- a/clang/test/Modules/Inputs/redecl-merge-bottom.h
+++ b/clang/test/Modules/Inputs/redecl-merge-bottom.h
@@ -2,6 +2,9 @@
 
 @class C4;
 @class C4;
+@protocol P4;
+@protocol P4;
+@protocol P4;
 __import_module__ redecl_merge_right;
 
 @class B;
diff --git a/clang/test/Modules/Inputs/redecl-merge-left.h b/clang/test/Modules/Inputs/redecl-merge-left.h
index 2d77bad..4ea1e70e 100644
--- a/clang/test/Modules/Inputs/redecl-merge-left.h
+++ b/clang/test/Modules/Inputs/redecl-merge-left.h
@@ -35,6 +35,10 @@
 
 struct explicit_struct;
 
+@protocol P3, P4;
+
+@protocol P3;
+
 #ifdef __cplusplus
 template<typename T> class Vector;
 
diff --git a/clang/test/Modules/Inputs/redecl-merge-right.h b/clang/test/Modules/Inputs/redecl-merge-right.h
index c5e35b1..82051d4 100644
--- a/clang/test/Modules/Inputs/redecl-merge-right.h
+++ b/clang/test/Modules/Inputs/redecl-merge-right.h
@@ -42,6 +42,11 @@
 
 struct explicit_struct;
 
+@protocol P4, P3;
+@protocol P3;
+@protocol P3;
+@protocol P3;
+
 #ifdef __cplusplus
 template<typename T> class Vector { 
 public:
diff --git a/clang/test/Modules/redecl-merge.m b/clang/test/Modules/redecl-merge.m
index d792739..4ea982b 100644
--- a/clang/test/Modules/redecl-merge.m
+++ b/clang/test/Modules/redecl-merge.m
@@ -6,6 +6,7 @@
 @class C3;
 __import_module__ redecl_merge_left;
 
+@protocol P4;
 @class C3;
 @class C3;
 __import_module__ redecl_merge_right;
@@ -83,6 +84,13 @@
   [a init];
 }
 
+@protocol P3
+- (void)p3_method;
+@end
+
+id<P4> p4;
+id<P3> p3;
+
 #ifdef __cplusplus
 void testVector() {
   Vector<int> vec_int;