OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc/] [execute/] [load-2.m] - Blame information for rev 378

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

Line No. Rev Author Line
1 307 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.