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

powered by: WebSVN 2.1.0

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