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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [property/] [at-property-11.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Contributed by Nicola Pero , October 2010.  */
2
/* { dg-do run } */
3
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
4
 
5
/* Test that properties are found even if implemented in superclasses.  */
6
 
7
#include 
8
#include 
9
#include 
10
 
11
@interface MyRootClass
12
{
13
  Class isa;
14
  int a;
15
}
16
@property (nonatomic) int a;
17
+ (id) initialize;
18
+ (id) alloc;
19
- (id) init;
20
@end
21
 
22
@implementation MyRootClass
23
+ (id) initialize { return self; }
24
+ (id) alloc { return class_createInstance (self, 0); }
25
- (id) init { return self; }
26
@synthesize a;
27
@end
28
 
29
@interface MySubClass : MyRootClass
30
@end
31
 
32
@implementation MySubClass
33
@end
34
 
35
int main (void)
36
{
37
  MySubClass *object = [[MySubClass alloc] init];
38
 
39
  object.a = 40;
40
  if (object.a != 40)
41
    abort ();
42
 
43
  return (0);
44
}

powered by: WebSVN 2.1.0

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