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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [property/] [dotsyntax-13.mm] - Blame information for rev 709

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

Line No. Rev Author Line
1 703 jeremybenn
/* Contributed by Nicola Pero , November 2010.  */
2
/* { dg-do run } */
3
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
4
 
5
/* Test dot-syntax with a local variable.  */
6
 
7
#include 
8
#include 
9
#include 
10
 
11
@interface MyRootClass
12
{
13
  Class isa;
14
  int a;
15
}
16
+ (id) initialize;
17
+ (id) alloc;
18
- (id) init;
19
- (int) count;
20
- (void) setCount: (int)count;
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
- (int) count
28
{
29
  return a;
30
}
31
- (void) setCount: (int)count
32
{
33
  a = count;
34
}
35
@end
36
 
37
int main (void)
38
{
39
  MyRootClass *object = [[MyRootClass alloc] init];
40
  int i;
41
 
42
  for (i = 0; i < 10; i++)
43
    {
44
      object.count = i;
45
 
46
      if (object.count != i)
47
        abort ();
48
    }
49
 
50
  return 0;
51
}
52
 
53
 

powered by: WebSVN 2.1.0

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