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-14.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Contributed by Nicola Pero , November 2010.  */
2
/* { dg-do compile } */
3
 
4
/* Test dot-syntax with accessors to be looked up in protocol @properties.  */
5
 
6
#include 
7
#include 
8
#include 
9
 
10
@protocol ProtocolA
11
@property int countA;
12
@end
13
 
14
@protocol ProtocolB
15
@property int countB;
16
@end
17
 
18
@protocol ProtocolC
19
@property int countC;
20
@end
21
 
22
@interface MyRootClass
23
{
24
  Class isa;
25
}
26
+ (id) initialize;
27
+ (id) alloc;
28
- (id) init;
29
@end
30
 
31
@interface MySubClass 
32
@end
33
 
34
int function (MySubClass *object, int x)
35
{
36
  object.countA = x;
37
  object.countB = x;
38
  object.countC = object.countB;
39
 
40
  return object.countC;
41
}
42
 
43
int function2 (MyRootClass  *object, int x)
44
{
45
  object.countA = x;
46
  object.countB = x;
47
  object.countC = object.countB;
48
 
49
  return object.countC;
50
}
51
 
52
int function3 (MyRootClass  *object, int x)
53
{
54
  object.countA = x;
55
  object.countB = x;
56
  object.countC = object.countB; /* { dg-error "request for member .countC. in" } */
57
 
58
  return object.countC;          /* { dg-error "request for member .countC. in" } */
59
}
60
 
61
int function4 (id  object, int x)
62
{
63
  object.countA = x;
64
  object.countB = x;
65
  object.countC = object.countB;
66
 
67
  return object.countC;
68
}
69
 
70
int function5 (id  object, int x)
71
{
72
  object.countA = x;
73
  object.countB = x;
74
  object.countC = object.countB; /* { dg-error "request for member .countC. in" } */
75
 
76
  return object.countC;          /* { dg-error "request for member .countC. in" } */
77
}

powered by: WebSVN 2.1.0

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