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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [property/] [property-1.m] - Blame information for rev 704

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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