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