aix: Fix building fat library for AIX
[official-gcc.git] / gcc / testsuite / objc.dg / class-extension-2.m
blob293facb189f88ddd9fff632c8b3f0ef08b230c03
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.  */
7 #include <objc/objc.h>
9 /* First, a simple test where a plain class has a protocol attached to
10    it in a class extension.  */
11 @interface MyObject
13   Class isa;
15 @end
17 @protocol MyProtocol
18 - (void) test;
19 @end
21 @interface MyObject () <MyProtocol>
22 @end
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>
34 @end
36 @protocol MyProtocol2
37 - (void) test2;
38 @end
40 @protocol MyProtocol3
41 - (void) test3;
42 @end
44 @interface MyObject2 () <MyProtocol2>
45 @end
47 @interface MyObject2 () <MyProtocol3>
48 @end
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 } */