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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [objc/] [execute/] [load.m] - Diff between revs 307 and 384

Only display areas with differences | Details | Blame | View Log

Rev 307 Rev 384
/* 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 +load is automatically called before main is run */
/* Test that +load is automatically called before main is run */
 
 
static int static_variable = 0;
static int static_variable = 0;
 
 
@interface TestClass
@interface TestClass
{
{
  Class isa;
  Class isa;
}
}
+ (void) load;
+ (void) load;
@end
@end
 
 
@implementation TestClass
@implementation TestClass
+ (void) load
+ (void) load
{
{
  static_variable = 1;
  static_variable = 1;
}
}
@end
@end
 
 
int main (void)
int main (void)
{
{
  if (static_variable != 1)
  if (static_variable != 1)
    {
    {
      abort ();
      abort ();
    }
    }
 
 
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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