Implemented type checking for pointer of objects of protocol-qualified types.
Note that incompatible-protocol-qualified-types.m is currently failing. This is
unrelated to this patch and Steve is looking at the general problem of not reporting
incompitible pointer types in return stetement..


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44897 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/incompatible-protocol-qualified-types.m b/test/Sema/incompatible-protocol-qualified-types.m
new file mode 100644
index 0000000..0594eb7
--- /dev/null
+++ b/test/Sema/incompatible-protocol-qualified-types.m
@@ -0,0 +1,40 @@
+// RUN: clang -fsyntax-only -verify %s
+
+@protocol MyProto1 
+@end
+
+@protocol MyProto2 
+@end
+
+@interface INTF @end
+
+INTF <MyProto1> * Func(INTF <MyProto1, MyProto2> *p2)
+{
+	return p2;
+}
+
+
+INTF <MyProto1> * Func1(INTF <MyProto1, MyProto2> *p2)
+{
+	return p2;
+}
+
+INTF <MyProto1, MyProto2> * Func2(INTF <MyProto1> *p2)
+{
+	Func(p2);	// expected-warning {{incompatible pointer types passing}}
+	return p2;	// expected-warning {{incompatible pointer types passing}}
+}
+
+
+
+INTF <MyProto1> * Func3(INTF <MyProto2> *p2)
+{
+	return p2;	// expected-warning {{incompatible pointer types passing}}
+}
+
+
+INTF <MyProto1, MyProto2> * Func4(INTF <MyProto2, MyProto1> *p2)
+{
+	return p2;
+}
+