Merged r157653 through r157895 into branch.
[official-gcc.git] / gcc / testsuite / objc / execute / formal_protocol-6.m
blobdd42b370192e365d1135997c012f75da6bc17d85
1 /* Contributed by Nicola Pero - Fri Mar  9 21:35:47 CET 2001 */
3 #include <stdlib.h>
4 #include "../../objc-obj-c++-shared/Protocol1.h"
6 /* Test defining a protocol, and accessing it using @protocol */
8 @protocol Evaluating
9 - (int) importance;
10 @end
12 /* Without a class adopting the protocol - this doesn't work 
13    with gcc-2.95.2 as well */
15 int main (void)
17   Protocol *protocol = @protocol (Evaluating);
19 #ifdef NEXT_OBJC_USE_NEW_INTERFACE
20   if (strcmp (protocol_getName(protocol), "Evaluating"))
21 #else
22   if (strcmp ([protocol name], "Evaluating"))
23 #endif
24     {
25       abort ();
26     }
28   return 0;