OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc/] [execute/] [enumeration-2.m] - Blame information for rev 717

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 702 jeremybenn
/* 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
 
5
typedef enum { black, white } color;
6
 
7
typedef 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
 
33
int 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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.