[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGenObjC / newproperty-nested-synthesis-1.m
blobaa0c8c923971eeee780d9f317d6dcf35e5271637
1 // RUN: %clang_cc1 -emit-llvm -o %t %s
2 // REQUIRES: LP64
4 @interface Object
5 - (id) new;
6 @end
8 @interface Tester : Object
9 @property char PropertyAtomic_char;
10 @property short PropertyAtomic_short;
11 @property int PropertyAtomic_int;
12 @property long PropertyAtomic_long;
13 @property long long PropertyAtomic_longlong;
14 @property float PropertyAtomic_float;
15 @property double PropertyAtomic_double;
16 @property(assign) id PropertyAtomic_id;
17 @property(retain) id PropertyAtomicRetained_id;
18 @property(copy) id PropertyAtomicRetainedCopied_id;
19 @property(retain) id PropertyAtomicRetainedGCOnly_id;
20 @property(copy) id PropertyAtomicRetainedCopiedGCOnly_id;
21 @end
23 @implementation Tester
24 @dynamic PropertyAtomic_char;
25 @dynamic PropertyAtomic_short;
26 @dynamic PropertyAtomic_int;
27 @dynamic PropertyAtomic_long;
28 @dynamic PropertyAtomic_longlong;
29 @dynamic PropertyAtomic_float;
30 @dynamic PropertyAtomic_double;
31 @dynamic PropertyAtomic_id;
32 @dynamic PropertyAtomicRetained_id;
33 @dynamic PropertyAtomicRetainedCopied_id;
34 @dynamic PropertyAtomicRetainedGCOnly_id;
35 @dynamic PropertyAtomicRetainedCopiedGCOnly_id;
36 @end
38 @interface SubClass : Tester
40     char PropertyAtomic_char;
41     short PropertyAtomic_short;
42     int PropertyAtomic_int;
43     long PropertyAtomic_long;
44     long long PropertyAtomic_longlong;
45     float PropertyAtomic_float;
46     double PropertyAtomic_double;
47     id PropertyAtomic_id;
48     id PropertyAtomicRetained_id;
49     id PropertyAtomicRetainedCopied_id;
50     id PropertyAtomicRetainedGCOnly_id;
51     id PropertyAtomicRetainedCopiedGCOnly_id;
53 @end
55 @implementation SubClass
56 @synthesize PropertyAtomic_char;
57 @synthesize PropertyAtomic_short;
58 @synthesize PropertyAtomic_int;
59 @synthesize PropertyAtomic_long;
60 @synthesize PropertyAtomic_longlong;
61 @synthesize PropertyAtomic_float;
62 @synthesize PropertyAtomic_double;
63 @synthesize PropertyAtomic_id;
64 @synthesize PropertyAtomicRetained_id;
65 @synthesize PropertyAtomicRetainedCopied_id;
66 @synthesize PropertyAtomicRetainedGCOnly_id;
67 @synthesize PropertyAtomicRetainedCopiedGCOnly_id;
68 @end
70 int main()
72     SubClass *f = [SubClass new];
73     f.PropertyAtomic_int = 1;
75     f.PropertyAtomic_int += 3;
77     f.PropertyAtomic_int -= 4;
78     return f.PropertyAtomic_int;