2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / objc / execute / formal_protocol-5.m
blob3d9f778fe63a684e9588e997b9294b516d16ed85
1 /* Contributed by Nicola Pero - Fri Mar  9 21:35:47 CET 2001 */
2 #include <objc/objc.h>
3 #include <objc/Protocol.h>
5 /* Test defining a protocol, and accessing it using @protocol */
7 @protocol Evaluating
8 - (int) importance;
9 @end
11 /* A class adopting the protocol */
12 @interface Test <Evaluating>
13 @end
15 @implementation Test
16 - (int) importance
18   return 1000;
20 @end
22 int main (void)
24   Protocol *protocol = @protocol (Evaluating);
26   if (strcmp ([protocol name], "Evaluating"))
27     {
28       abort ();
29     }
31   return 0;