Fix unused warnings.
[official-gcc/graphite-test-results.git] / gcc / testsuite / objc / execute / enumeration-2.m
blobc47bb8a583d901686cd869517fbd48e89a41e9d8
1 /* Contributed by Nicola Pero -  Wed Dec  5 17:12:40 GMT 2001 */
2 #include <stdlib.h>
3 #import "../../objc-obj-c++-shared/Object1.h"
4 #include <objc/objc.h>
6 typedef enum { black, white } color;
8 typedef struct 
10   color a:2;
11   color b:2;
12 } color_couple;
14 @interface TestClass: Object
16   color_couple *c;
18 - (color_couple *)colorCouple;
19 - (void)setColorCouple: (color_couple *)a;
20 @end
22 @implementation TestClass
23 - (color_couple *)colorCouple
25   return c;
27 - (void)setColorCouple: (color_couple *)a
29   c = a;
31 @end
34 int main (void)
36   color_couple cc;
37   TestClass *c;
38   
39   c = [TestClass new];
40   
41   cc.a = black;
42   cc.b = white;
44   [c setColorCouple: &cc];
45   if ([c colorCouple] != &cc)
46     {
47       abort ();
48     }
49   
51   return 0;