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