blob: 147f007b946bdbd04e9a2f43a94b06b5fa5d2c45 (
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
32
|
/* This program tests use of property provided setter/getter functions. */
/* { dg-options "-std=c99" } */
/* { dg-do run } */
/* { dg-additional-sources "../../objc-obj-c++-shared/Object1.m" } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
#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;
}
|