Debian Codegraph @

gcc/testsuite/obj-c++.dg/property/property-1.mm

raw
1 /* 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