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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc/] [execute/] [load.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 +load is automatically called before main is run */
5
 
6
static int static_variable = 0;
7
 
8
@interface TestClass
9
{
10
  Class isa;
11
}
12
+ (void) load;
13
@end
14
 
15
@implementation TestClass
16
+ (void) load
17
{
18
  static_variable = 1;
19
}
20
@end
21
 
22
int main (void)
23
{
24
  if (static_variable != 1)
25
    {
26
      abort ();
27
    }
28
 
29
  return 0;
30
}

powered by: WebSVN 2.1.0

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