URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
/* Contributed by Nicola Pero - Wed Mar 7 17:55:04 CET 2001 */
|
/* Contributed by Nicola Pero - Wed Mar 7 17:55:04 CET 2001 */
|
#include <objc/objc.h>
|
#include <objc/objc.h>
|
|
|
/* Test that +initialize is automatically called before the class is
|
/* Test that +initialize is automatically called before the class is
|
accessed */
|
accessed */
|
|
|
static int class_variable = 0;
|
static int class_variable = 0;
|
|
|
@interface TestClass
|
@interface TestClass
|
{
|
{
|
Class isa;
|
Class isa;
|
}
|
}
|
+ (void) initialize;
|
+ (void) initialize;
|
+ (int) classVariable;
|
+ (int) classVariable;
|
@end
|
@end
|
|
|
@implementation TestClass
|
@implementation TestClass
|
+ (void) initialize
|
+ (void) initialize
|
{
|
{
|
class_variable = 1;
|
class_variable = 1;
|
}
|
}
|
+ (int) classVariable
|
+ (int) classVariable
|
{
|
{
|
return class_variable;
|
return class_variable;
|
}
|
}
|
@end
|
@end
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
if ([TestClass classVariable] != 1)
|
if ([TestClass classVariable] != 1)
|
{
|
{
|
abort ();
|
abort ();
|
}
|
}
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.