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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* This program tests use of property provided setter/getter functions. */
2
/* { dg-do run } */
3
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
4
 
5
#import "../../objc-obj-c++-shared/TestsuiteObject.m"
6
 
7
@interface Bar : TestsuiteObject
8
{
9
  int iVar;
10
}
11
@property (setter=MySetter:) int FooBar;
12
@end
13
 
14
@implementation Bar
15
@synthesize FooBar=iVar;
16
 
17
- (void) MySetter : (int) value { iVar = value; }
18
 
19
@end
20
 
21
int main(int argc, char *argv[]) {
22
    Bar *f = [Bar new];
23
    f.FooBar = 1;
24
 
25
    f.FooBar += 3;
26
 
27
    f.FooBar -= 4;
28
    return f.FooBar;
29
}
30
 

powered by: WebSVN 2.1.0

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