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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc/] [execute/] [initialize.m] - Blame information for rev 702

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 702 jeremybenn
/* Contributed by Nicola Pero - Wed Mar  7 17:55:04 CET 2001 */
2
#include <objc/objc.h>
3
 
4
/* Test that +initialize is automatically called before the class is
5
   accessed */
6
 
7
static int class_variable = 0;
8
 
9
@interface TestClass
10
{
11
  Class isa;
12
}
13
+ (void) initialize;
14
+ (int) classVariable;
15
@end
16
 
17
@implementation TestClass
18
+ (void) initialize
19
{
20
  class_variable = 1;
21
}
22
+ (int) classVariable
23
{
24
  return class_variable;
25
}
26
@end
27
 
28
int main (void)
29
{
30
  if ([TestClass classVariable] != 1)
31
    {
32
      abort ();
33
    }
34
 
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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