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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc/] [execute/] [load-2.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 Jun  6 14:34:23 CEST 2001 */
2
#include <objc/objc.h>
3
 
4
/* Test that +load is automatically called before main is run;
5
   on two different classes. */
6
 
7
static int static_variable1 = 0;
8
static int static_variable2 = 0;
9
 
10
@interface TestClass1
11
{
12
  Class isa;
13
}
14
+ (void) load;
15
@end
16
 
17
@implementation TestClass1
18
+ (void) load
19
{
20
  static_variable1 = 1;
21
}
22
@end
23
 
24
@interface TestClass2
25
{
26
  Class isa;
27
}
28
+ (void) load;
29
@end
30
 
31
@implementation TestClass2
32
+ (void) load
33
{
34
  static_variable2 = 1;
35
}
36
@end
37
 
38
int main (void)
39
{
40
  if (static_variable1 != 1  ||  static_variable2 != 1)
41
    {
42
      abort ();
43
    }
44
 
45
  return 0;
46
}

powered by: WebSVN 2.1.0

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