Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / objc / execute / formal_protocol-4.m
blobaf79606c065233808b9606fb088e411b1a8d3526
1 /* Contributed by Nicola Pero - Fri Mar  9 21:35:47 CET 2001 */
2 #include <objc/objc.h>
3 #include <objc/Object.h>
5 /* Test defining a protocol, a class adopting it in a category */
7 @protocol Evaluating
8 - (int) importance;
9 @end
11 @interface Feature : Object
12 @end
14 @implementation Feature
15 @end
17 @interface Feature (EvaluatingProtocol) <Evaluating>
18 @end
20 @implementation Feature (EvaluatingProtocol)
21 - (int) importance
23   return 1000;
25 @end
27 int main (void)
29   id <Evaluating> object;
31   object = [Feature new];
33   if ([object importance] != 1000)
34     {
35       abort ();
36     }
38   return 0;