xref: /llvm-project/clang/test/CodeGenObjC/default-property-synthesis.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s
2
3// Superclass declares property. Subclass redeclares the same property.
4// Do not @synthesize-by-default in the subclass. P1
5// Superclass declares a property. Subclass declares a different property with the same name
6// (such as different type or attributes). Do not @synthesize-by-default in the subclass. P2
7// Superclass conforms to a protocol that declares a property. Subclass redeclares the
8// same property.  Do not @synthesize-by-default in the subclass. P3
9// Superclass conforms to a protocol that declares a property. Subclass conforms to the
10// same protocol or a derived protocol. Do not @synthesize-by-default in the subclass. P4
11
12
13@protocol PROTO
14  @property int P3;
15  @property int P4;
16@end
17
18@protocol PROTO1 <PROTO>
19  @property int IMP1;
20@end
21
22@interface Super <PROTO>
23  @property int P1;
24  @property (copy) id P2;
25@end
26
27@interface Sub : Super <PROTO1>
28  @property int P1;
29  @property (nonatomic, retain) id P2; // expected-warning {{property 'P2' 'copy' attribute does not match the property inherited from 'Super'}} \
30				       // expected-warning {{property 'P2' 'atomic' attribute does not match the property inherited from 'Super'}}
31  @property int P3;
32  @property int IMP2;
33@end
34
35@implementation Sub
36@end
37
38