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/] [many_args_method.m] - Diff between revs 307 and 384

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

Rev 307 Rev 384
/* Contributed by Nicola Pero - Fri Mar  9 19:39:15 CET 2001 */
/* Contributed by Nicola Pero - Fri Mar  9 19:39:15 CET 2001 */
#include <objc/objc.h>
#include <objc/objc.h>
 
 
/* Test the syntax of methods with many arguments */
/* Test the syntax of methods with many arguments */
 
 
@interface TestClass
@interface TestClass
{
{
  Class isa;
  Class isa;
}
}
+ (int) sumInteger: (int)a   withInteger: (int)b;
+ (int) sumInteger: (int)a   withInteger: (int)b;
+ (int) sum: (int)a   : (int)b;
+ (int) sum: (int)a   : (int)b;
+ (int) sumInteger: (int)a   withInteger: (int)b  withInteger: (int)c;
+ (int) sumInteger: (int)a   withInteger: (int)b  withInteger: (int)c;
+ (int) sum: (int)a   : (int)b  : (int)c;
+ (int) sum: (int)a   : (int)b  : (int)c;
@end
@end
 
 
@implementation TestClass
@implementation TestClass
+ (int) sumInteger: (int)a  withInteger: (int)b
+ (int) sumInteger: (int)a  withInteger: (int)b
{
{
  return a + b;
  return a + b;
}
}
+ (int) sum: (int)a   : (int)b
+ (int) sum: (int)a   : (int)b
{
{
  return [self sumInteger: a  withInteger: b];
  return [self sumInteger: a  withInteger: b];
}
}
+ (int) sumInteger: (int)a   withInteger: (int)b  withInteger: (int)c
+ (int) sumInteger: (int)a   withInteger: (int)b  withInteger: (int)c
{
{
  return a + b + c;
  return a + b + c;
}
}
+ (int) sum: (int)a   : (int)b  : (int)c
+ (int) sum: (int)a   : (int)b  : (int)c
{
{
  return [self sumInteger: a  withInteger: b  withInteger: c];
  return [self sumInteger: a  withInteger: b  withInteger: c];
}
}
#ifdef __NEXT_RUNTIME__                                   
#ifdef __NEXT_RUNTIME__                                   
+ initialize { return self; }
+ initialize { return self; }
#endif
#endif
@end
@end
 
 
 
 
int main (void)
int main (void)
{
{
  if ([TestClass sumInteger: 1  withInteger: 1] != 2)
  if ([TestClass sumInteger: 1  withInteger: 1] != 2)
    {
    {
      abort ();
      abort ();
    }
    }
  if ([TestClass sum: 1  : 1] != 2)
  if ([TestClass sum: 1  : 1] != 2)
    {
    {
      abort ();
      abort ();
    }
    }
  if ([TestClass sumInteger: 1  withInteger: 1  withInteger: 1] != 3)
  if ([TestClass sumInteger: 1  withInteger: 1  withInteger: 1] != 3)
    {
    {
      abort ();
      abort ();
    }
    }
  if ([TestClass sum: 1  : 1  : 1] != 3)
  if ([TestClass sum: 1  : 1  : 1] != 3)
    {
    {
      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.