blob: 4447946d1ab5343ba5be693e4af31d9e24a075da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/* This program tests use of property provided setter/getter functions. */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
/* { dg-additional-sources "../../objc-obj-c++-shared/Object1.mm" } */
#import "../../objc-obj-c++-shared/Object1.h"
@interface Bar : Object
{
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;
}
|