OSDN Git Service

In gcc/objc/:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / fwd-proto-1.m
1 /* Test forward-decls for @protocols.  */
2 /* Author: Ziemowit Laski <zlaski@apple.com>.  */
3 /* { dg-do compile } */
4
5 /* One-line substitute for objc/objc.h */
6 typedef struct objc_object { struct objc_class *class_pointer; } *id;
7
8 @protocol Bar;
9 @protocol Boo;
10
11 @protocol Foo 
12 - (id <Bar>)someMethod;
13 - (id <Baz>)anotherMethod; /* { dg-error "annot find protocol declaration" } */
14 @end
15
16 @protocol Bar <Boo>
17 - (id <Foo>)someOtherMethod;
18 - (id <Baz>)anotherMethod; /* { dg-error "annot find protocol declaration" } */
19 - (id <Boo>)yetAnotherMethod;
20 @end
21
22 /* The following worthy test is stubbed out until we can get the
23    harness to match correctly on the "compilation terminated" message
24    when running on GNU/Linux.  sts 2001-08-01 */
25 #if 0
26 @protocol Boo <Bar>   /* { /*dg*/-error "has circular dependency" } */
27 @end
28 #endif
29