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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [property/] [synthesize-10.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 run } */
3
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
4
 
5
/* Test @synthesize with bitfield instance variables.  */
6
 
7
#include 
8
#include 
9
#include 
10
 
11
@interface MyRootClass
12
{
13
  Class isa;
14
  int countA : 2;
15
  int countB : 3;
16
  int countC : 4;
17
}
18
+ (id) initialize;
19
+ (id) alloc;
20
- (id) init;
21
@property (nonatomic) int countA;
22
@property (nonatomic) int countB;
23
@property (nonatomic) int countC;
24
@end
25
 
26
@implementation MyRootClass
27
+ (id) initialize { return self; }
28
+ (id) alloc { return class_createInstance (self, 0); }
29
- (id) init { return self; }
30
@synthesize countA;
31
@synthesize countB;
32
@synthesize countC;
33
@end
34
 
35
int main (void)
36
{
37
  MyRootClass *object = [[MyRootClass alloc] init];
38
 
39
  object.countA = 1;
40
  object.countB = 3;
41
  object.countC = 4;
42
 
43
  if (object.countA != 1)
44
    abort ();
45
 
46
  if (object.countB != 3)
47
    abort ();
48
 
49
  if (object.countC != 4)
50
    abort ();
51
 
52
  return 0;
53
}

powered by: WebSVN 2.1.0

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