2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / objc / execute / enumeration-2.m
bloba128da69ff30e11c9b2bff2eada371841431d6cd
1 /* Contributed by Nicola Pero -  Wed Dec  5 17:12:40 GMT 2001 */
2 #include <objc/objc.h>
3 #include <objc/Object.h>
5 typedef enum { black, white } color;
7 typedef struct 
9   color a:2;
10   color b:2;
11 } color_couple;
13 @interface TestClass: Object
15   color_couple *c;
17 - (color_couple *)colorCouple;
18 - (void)setColorCouple: (color_couple *)a;
19 @end
21 @implementation TestClass
22 - (color_couple *)colorCouple
24   return c;
26 - (void)setColorCouple: (color_couple *)a
28   c = a;
30 @end
33 int main (void)
35   color_couple cc;
36   TestClass *c;
37   
38   c = [TestClass new];
39   
40   cc.a = black;
41   cc.b = white;
43   [c setColorCouple: &cc];
44   if ([c colorCouple] != &cc)
45     {
46       abort ();
47     }
48   
50   return 0;