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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc/] [execute/] [static-1.m] - Blame information for rev 326

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

Line No. Rev Author Line
1 307 jeremybenn
/* Contributed by Nicola Pero - Fri Mar  9 19:39:15 CET 2001 */
2
#include <objc/objc.h>
3
 
4
/* Test defining a static variable *inside* a class implementation */
5
 
6
@interface Test
7
{
8
  Class isa;
9
}
10
+ (int) test;
11
@end
12
 
13
@implementation Test
14
 
15
static int test = 1;
16
 
17
+ (int) test
18
{
19
  return test;
20
}
21
 
22
#ifdef __NEXT_RUNTIME__                                   
23
+ initialize { return self; }
24
#endif
25
@end
26
 
27
int main (void)
28
{
29
  if ([Test test] != 1)
30
    {
31
      abort ();
32
    }
33
 
34
  return 0;
35
}
36
 
37
 

powered by: WebSVN 2.1.0

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