1*67e74705SXin Li// RUN: %clang_cc1 -fsyntax-only -verify -disable-objc-default-synthesize-properties %s 2*67e74705SXin Li// rdar://7884086 3*67e74705SXin Li 4*67e74705SXin Li@interface NSObject @end 5*67e74705SXin Li 6*67e74705SXin Li@protocol TopProtocol 7*67e74705SXin Li @property (readonly) id myString; // expected-note {{property}} 8*67e74705SXin Li@end 9*67e74705SXin Li 10*67e74705SXin Li@protocol SubProtocol <TopProtocol> 11*67e74705SXin Li@end 12*67e74705SXin Li 13*67e74705SXin Li@interface TopClass : NSObject <TopProtocol> {} 14*67e74705SXin Li@end 15*67e74705SXin Li 16*67e74705SXin Li@interface SubClass : TopClass <SubProtocol> {} 17*67e74705SXin Li@end 18*67e74705SXin Li 19*67e74705SXin Li@interface SubClass1 : TopClass {} 20*67e74705SXin Li@end 21*67e74705SXin Li 22*67e74705SXin Li@implementation SubClass1 @end // Test1 - No Warning 23*67e74705SXin Li 24*67e74705SXin Li@implementation TopClass // expected-warning {{property 'myString' requires method 'myString' to be defined}} 25*67e74705SXin Li@end 26*67e74705SXin Li 27*67e74705SXin Li@implementation SubClass // Test3 - No Warning 28*67e74705SXin Li@end 29*67e74705SXin Li 30*67e74705SXin Li@interface SubClass2 : TopClass<TopProtocol> 31*67e74705SXin Li@end 32*67e74705SXin Li 33*67e74705SXin Li@implementation SubClass2 @end // Test 4 - No Warning 34*67e74705SXin Li 35*67e74705SXin Li@interface SubClass3 : TopClass<SubProtocol> @end 36*67e74705SXin Li@implementation SubClass3 @end // Test 5 - No Warning 37*67e74705SXin Li 38*67e74705SXin Li@interface SubClass4 : SubClass3 @end 39*67e74705SXin Li@implementation SubClass4 @end // Test 5 - No Warning 40*67e74705SXin Li 41*67e74705SXin Li@protocol NewProtocol 42*67e74705SXin Li @property (readonly) id myNewString; // expected-note {{property}} 43*67e74705SXin Li@end 44*67e74705SXin Li 45*67e74705SXin Li@interface SubClass5 : SubClass4 <NewProtocol> @end 46*67e74705SXin Li@implementation SubClass5 @end // expected-warning {{property 'myNewString' requires method 'myNewString' to be defined}} 47*67e74705SXin Li 48*67e74705SXin Li 49*67e74705SXin Li// Radar 8035776 50*67e74705SXin Li@protocol SuperProtocol 51*67e74705SXin Li@end 52*67e74705SXin Li 53*67e74705SXin Li@interface Super <SuperProtocol> 54*67e74705SXin Li@end 55*67e74705SXin Li 56*67e74705SXin Li@protocol ProtocolWithProperty <SuperProtocol> 57*67e74705SXin Li@property (readonly, assign) id invalidationBacktrace; // expected-note {{property}} 58*67e74705SXin Li@end 59*67e74705SXin Li 60*67e74705SXin Li@interface INTF : Super <ProtocolWithProperty> 61*67e74705SXin Li@end 62*67e74705SXin Li 63*67e74705SXin Li@implementation INTF @end // expected-warning{{property 'invalidationBacktrace' requires method 'invalidationBacktrace' to be defined}} 64