1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s 2f4a2713aSLionel Sambuc 3f4a2713aSLionel Sambuc@interface I 4f4a2713aSLionel Sambuc- Meth; // expected-note 2 {{method 'Meth' declared here}} 5f4a2713aSLionel Sambuc- unavailableMeth __attribute__((availability(macosx,unavailable))); 6f4a2713aSLionel Sambuc- unavailableMeth2 __attribute__((unavailable)); 7f4a2713aSLionel Sambuc@end 8f4a2713aSLionel Sambuc 9f4a2713aSLionel Sambuc@implementation I // expected-warning {{method definition for 'Meth' not found}} 10f4a2713aSLionel Sambuc@end 11f4a2713aSLionel Sambuc 12f4a2713aSLionel Sambuc@implementation I(CAT) 13f4a2713aSLionel Sambuc- Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} 14f4a2713aSLionel Sambuc@end 15f4a2713aSLionel Sambuc 16f4a2713aSLionel Sambuc#pragma GCC diagnostic ignored "-Wincomplete-implementation" 17f4a2713aSLionel Sambuc@interface I2 18f4a2713aSLionel Sambuc- Meth; // expected-note{{method 'Meth' declared here}} 19f4a2713aSLionel Sambuc@end 20f4a2713aSLionel Sambuc 21f4a2713aSLionel Sambuc@implementation I2 22f4a2713aSLionel Sambuc@end 23f4a2713aSLionel Sambuc 24f4a2713aSLionel Sambuc@implementation I2(CAT) 25f4a2713aSLionel Sambuc- Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} 26f4a2713aSLionel Sambuc@end 27f4a2713aSLionel Sambuc 28f4a2713aSLionel Sambuc@interface Q 29f4a2713aSLionel Sambuc@end 30f4a2713aSLionel Sambuc 31f4a2713aSLionel Sambuc// rdar://10336158 32f4a2713aSLionel Sambuc@implementation Q 33f4a2713aSLionel Sambuc 34f4a2713aSLionel Sambuc__attribute__((visibility("default"))) 35f4a2713aSLionel Sambuc@interface QN // expected-error {{Objective-C declarations may only appear in global scope}} 36f4a2713aSLionel Sambuc{ 37f4a2713aSLionel Sambuc} 38f4a2713aSLionel Sambuc@end 39f4a2713aSLionel Sambuc 40f4a2713aSLionel Sambuc@end 41f4a2713aSLionel Sambuc 42*0a6a1f1dSLionel Sambuc// rdar://15580969 43*0a6a1f1dSLionel Sambuctypedef char BOOL; 44*0a6a1f1dSLionel Sambuc 45*0a6a1f1dSLionel Sambuc@protocol NSObject 46*0a6a1f1dSLionel Sambuc- (BOOL)isEqual:(id)object; 47*0a6a1f1dSLionel Sambuc@end 48*0a6a1f1dSLionel Sambuc 49*0a6a1f1dSLionel Sambuc@interface NSObject <NSObject> 50*0a6a1f1dSLionel Sambuc@end 51*0a6a1f1dSLionel Sambuc 52*0a6a1f1dSLionel Sambuc@protocol NSApplicationDelegate <NSObject> 53*0a6a1f1dSLionel Sambuc- (void)ImpleThisMethod; // expected-note {{method 'ImpleThisMethod' declared here}} 54*0a6a1f1dSLionel Sambuc@end 55*0a6a1f1dSLionel Sambuc 56*0a6a1f1dSLionel Sambuc@interface AppDelegate : NSObject <NSApplicationDelegate> 57*0a6a1f1dSLionel Sambuc@end 58*0a6a1f1dSLionel Sambuc 59*0a6a1f1dSLionel Sambuc@implementation AppDelegate (MRRCategory) 60*0a6a1f1dSLionel Sambuc 61*0a6a1f1dSLionel Sambuc- (BOOL)isEqual:(id)object 62*0a6a1f1dSLionel Sambuc{ 63*0a6a1f1dSLionel Sambuc return __objc_no; 64*0a6a1f1dSLionel Sambuc} 65*0a6a1f1dSLionel Sambuc 66*0a6a1f1dSLionel Sambuc- (void)ImpleThisMethod {} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} 67*0a6a1f1dSLionel Sambuc@end 68