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.dg/] [super-class-3.m] - Diff between revs 309 and 384

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

Rev 309 Rev 384
/* Ensure that the compiler does not emit spurious extern declarations named '_Foo', where 'Foo'
/* Ensure that the compiler does not emit spurious extern declarations named '_Foo', where 'Foo'
   is an ObjC class name.  */
   is an ObjC class name.  */
/* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
/* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
/* { dg-do run } */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
 
 
#include "../objc-obj-c++-shared/Object1.h"
#include "../objc-obj-c++-shared/Object1.h"
 
 
#include <stdlib.h>
#include <stdlib.h>
#define CHECK_IF(expr) if(!(expr)) abort()
#define CHECK_IF(expr) if(!(expr)) abort()
 
 
@interface _Child: Object
@interface _Child: Object
+ (int) flashCache;
+ (int) flashCache;
@end
@end
 
 
@interface Child: _Child
@interface Child: _Child
+ (int) flushCache1;
+ (int) flushCache1;
@end
@end
 
 
@interface Child (Categ)
@interface Child (Categ)
+ (int) flushCache2;
+ (int) flushCache2;
@end
@end
 
 
int _Object = 23;  /* Should not conflict with @interface Object.  */
int _Object = 23;  /* Should not conflict with @interface Object.  */
 
 
@implementation _Child
@implementation _Child
+ (int) flashCache { return 12 + _Object; }
+ (int) flashCache { return 12 + _Object; }
@end
@end
 
 
@implementation Child
@implementation Child
+ (int) flushCache1 { return 7 + [super flashCache]; }
+ (int) flushCache1 { return 7 + [super flashCache]; }
@end
@end
 
 
@implementation Child (Categ)
@implementation Child (Categ)
+ (int) flushCache2 { return 9 + [super flashCache]; }
+ (int) flushCache2 { return 9 + [super flashCache]; }
@end
@end
 
 
int main(void) {
int main(void) {
  CHECK_IF([_Child flashCache] == 35);
  CHECK_IF([_Child flashCache] == 35);
  CHECK_IF([Child flushCache1] == 42);
  CHECK_IF([Child flushCache1] == 42);
  CHECK_IF([Child flushCache2] == 44);
  CHECK_IF([Child flushCache2] == 44);
 
 
  return 0;
  return 0;
}
}
 
 
#include "../objc-obj-c++-shared/Object1-implementation.h"
#include "../objc-obj-c++-shared/Object1-implementation.h"
 
 

powered by: WebSVN 2.1.0

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