1/* Contributed by Nicola Pero - Wed Dec 5 17:12:40 GMT 2001 */ 2#include <stdlib.h> 3#import "../../objc-obj-c++-shared/TestsuiteObject.m" 4 5typedef enum { black, white } color; 6 7typedef struct 8{ 9 color a:2; 10 color b:2; 11} color_couple; 12 13@interface TestClass: TestsuiteObject 14{ 15 color_couple *c; 16} 17- (color_couple *)colorCouple; 18- (void)setColorCouple: (color_couple *)a; 19@end 20 21@implementation TestClass 22- (color_couple *)colorCouple 23{ 24 return c; 25} 26- (void)setColorCouple: (color_couple *)a 27{ 28 c = a; 29} 30@end 31 32 33int main (void) 34{ 35 color_couple cc; 36 TestClass *c; 37 38 c = [TestClass new]; 39 40 cc.a = black; 41 cc.b = white; 42 43 [c setColorCouple: &cc]; 44 if ([c colorCouple] != &cc) 45 { 46 abort (); 47 } 48 49 50 return 0; 51} 52 53