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] - Rev 801

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

/* This program tests use of property provided setter/getter functions. */
/* { dg-options "-std=c99" } */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
 
#import "../../objc-obj-c++-shared/TestsuiteObject.m"
 
@interface Bar : TestsuiteObject
{
  int iVar;
}
@property (setter=MySetter:) int FooBar;
@end
 
@implementation Bar
@synthesize FooBar=iVar;
 
- (void) MySetter : (int) value { iVar = value; }
 
@end
 
int main(int argc, char *argv[]) {
    Bar *f = [Bar new];
    f.FooBar = 1;
 
    f.FooBar += 3;
 
    f.FooBar -= 4;
    return f.FooBar;
}
 
 

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

powered by: WebSVN 2.1.0

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