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-12.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 atomic, assign synthesized methods.  */
6
 
7
#include 
8
#include 
9
#include 
10
 
11
@interface MyRootClass
12
{
13
  Class isa;
14
  int a;
15
  id b;
16
}
17
@property int a;
18
@property (assign) id b;
19
+ (id) initialize;
20
+ (id) alloc;
21
- (id) init;
22
@end
23
 
24
@implementation MyRootClass
25
+ (id) initialize { return self; }
26
+ (id) alloc { return class_createInstance (self, 0); }
27
- (id) init { return self; }
28
@synthesize a;
29
@synthesize b;
30
@end
31
 
32
int main (void)
33
{
34
  MyRootClass *object = [[MyRootClass alloc] init];
35
 
36
  object.a = 40;
37
  if (object.a != 40)
38
    abort ();
39
 
40
  object.b = object;
41
  if (object.b != object)
42
    abort ();
43
 
44
  return (0);
45
}
46
 
47
 

powered by: WebSVN 2.1.0

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