1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
2 /* { dg-do compile } */
4 /* Test that all protocols appearing in @interface declarations are
5 real (ie, we saw a full @protocol definition with list of methods),
6 and not just forward-references (ie, "@protocol NSObject;"). This
7 test checks protocols implemented by other protocols. */
13 @interface MyClass <MyProtocol> /* { dg-warning "definition of protocol .MyProtocol. not found" } */
17 @protocol MyProtocol2 <MyProtocol>
21 @interface MyClass2 <MyProtocol2> /* { dg-warning "definition of protocol .MyProtocol. not found" } */
26 @protocol MyProtocol3 <MyProtocol2>
30 @interface MyClass3 <MyProtocol3> /* { dg-warning "definition of protocol .MyProtocol. not found" } */
36 @protocol MyProtocol4 <MyProtocol3, MyProtocol2>
40 @interface MyClass4 <MyProtocol4> /* { dg-warning "definition of protocol .MyProtocol. not found" } */
51 @interface MyClass5 <MyProtocol5> /* Ok */
56 @protocol MyProtocol6 <MyProtocol5>
60 @interface MyClass6 <MyProtocol6> /* Ok */
66 @protocol MyProtocol7 <MyProtocol5, MyProtocol4>
70 @interface MyClass7 <MyProtocol7> /* { dg-warning "definition of protocol .MyProtocol. not found" } */
79 /* Now test that if we finally define MyProtocol, the warnings go away. */
84 @protocol MyProtocol8 <MyProtocol5, MyProtocol4>
88 @interface MyClass8 <MyProtocol8> /* Ok */