Fix <rdar://problem/6144382> [sema] gcc inconsistency w.r.t. forward protocol declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66161 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjC/protocol-forward-circular.m b/test/SemaObjC/protocol-forward-circular.m
new file mode 100644
index 0000000..836d5b2
--- /dev/null
+++ b/test/SemaObjC/protocol-forward-circular.m
@@ -0,0 +1,10 @@
+// RUN: clang -fsyntax-only -verify %s
+
+@protocol B;
+@protocol C < B > // expected-warning{{cannot find protocol definition for 'B'}} // expected-note{{previous definition is here}}
+@end
+@protocol A < C >
+@end
+@protocol B < A > // expected-error{{protocol has circular dependency}}
+@end
+