1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
2 /* { dg-do compile } */
4 /* This test tests class extensions and protocols. */
8 /* First, a simple test where a plain class has a protocol attached to
9 it in a class extension. */
20 @interface MyObject () <MyProtocol>
23 @implementation MyObject
24 @end /* { dg-warning "incomplete implementation of class .MyObject." } */
25 /* { dg-warning "method definition for .-test. not found" "" { target *-*-* } 24 } */
26 /* { dg-warning "class .MyObject. does not fully implement the .MyProtocol. protocol" "" { target *-*-* } 24 } */
30 /* Second, a more interesting test where protocols are added from the
31 main class and from two different class extensions. */
32 @interface MyObject2 : MyObject <MyProtocol>
43 @interface MyObject2 () <MyProtocol2>
46 @interface MyObject2 () <MyProtocol3>
49 @implementation MyObject2
50 @end /* { dg-warning "incomplete implementation of class .MyObject2." } */
51 /* { dg-warning "method definition for .-test. not found" "" { target *-*-* } 50 } */
52 /* { dg-warning "class .MyObject2. does not fully implement the .MyProtocol. protocol" "" { target *-*-* } 50 } */
53 /* { dg-warning "method definition for .-test2. not found" "" { target *-*-* } 50 } */
54 /* { dg-warning "class .MyObject2. does not fully implement the .MyProtocol2. protocol" "" { target *-*-* } 50 } */
55 /* { dg-warning "method definition for .-test3. not found" "" { target *-*-* } 50 } */
56 /* { dg-warning "class .MyObject2. does not fully implement the .MyProtocol3. protocol" "" { target *-*-* } 50 } */