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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc.dg/] [super-class-3.m] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
/* Ensure that the compiler does not emit spurious extern declarations named '_Foo', where 'Foo'
2
   is an ObjC class name.  */
3
/* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
4
/* { dg-do run } */
5
 
6
#include <objc/Object.h>
7
#include <stdlib.h>
8
#define CHECK_IF(expr) if(!(expr)) abort()
9
 
10
@interface _Child: Object
11
+ (int) flashCache;
12
@end
13
 
14
@interface Child: _Child
15
+ (int) flushCache1;
16
@end
17
 
18
@interface Child (Categ)
19
+ (int) flushCache2;
20
@end
21
 
22
int _Object = 23;  /* Should not conflict with @interface Object.  */
23
 
24
@implementation _Child
25
+ (int) flashCache { return 12 + _Object; }
26
@end
27
 
28
@implementation Child
29
+ (int) flushCache1 { return 7 + [super flashCache]; }
30
@end
31
 
32
@implementation Child (Categ)
33
+ (int) flushCache2 { return 9 + [super flashCache]; }
34
@end
35
 
36
int main(void) {
37
  CHECK_IF([_Child flashCache] == 35);
38
  CHECK_IF([Child flushCache1] == 42);
39
  CHECK_IF([Child flushCache2] == 44);
40
 
41
  return 0;
42
}
43
 

powered by: WebSVN 2.1.0

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