2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / objc.dg / fwd-proto-1.m
blob3b21c513c52e6b66dff7597acd8838a8dae5b82d
1 /* Test forward-decls for @protocols.  */
2 /* Author: Ziemowit Laski <zlaski@apple.com>.  */
3 /* { dg-do compile } */
5 /* One-line substitute for objc/objc.h */
6 typedef struct objc_object { struct objc_class *class_pointer; } *id;
8 @protocol Bar;
9 @protocol Boo;
11 @protocol Foo 
12 - (id <Bar>)someMethod;
13 - (id <Baz>)anotherMethod; /* { dg-error "annot find protocol declaration" } */
14 @end
16 @protocol Bar <Boo>
17 - (id <Foo>)someOtherMethod;
18 - (id <Baz>)anotherMethod; /* { dg-error "annot find protocol declaration" } */
19 - (id <Boo>)yetAnotherMethod;
20 @end
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