1*67e74705SXin Li// RUN: %clang_cc1 -triple i386-unknown-unknown -verify -fsyntax-only -Wno-objc-root-class %s 2*67e74705SXin Li 3*67e74705SXin Li@class NSString; 4*67e74705SXin Li 5*67e74705SXin Li@interface A 6*67e74705SXin Li-t1 __attribute__((noreturn)); 7*67e74705SXin Li- (NSString *)stringByAppendingFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2))); 8*67e74705SXin Li-(void) m0 __attribute__((noreturn)); 9*67e74705SXin Li-(void) m1 __attribute__((unused)); 10*67e74705SXin Li-(void) m2 __attribute__((stdcall)); 11*67e74705SXin Li-(void) m3 __attribute__((optnone)); 12*67e74705SXin Li@end 13*67e74705SXin Li 14*67e74705SXin Li 15*67e74705SXin Li@interface INTF 16*67e74705SXin Li- (int) foo1: (int)arg1 __attribute__((deprecated)); 17*67e74705SXin Li 18*67e74705SXin Li- (int) foo: (int)arg1; 19*67e74705SXin Li 20*67e74705SXin Li- (int) foo2: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)); 21*67e74705SXin Li- (int) foo3: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)) __attribute__((ns_consumes_self)); 22*67e74705SXin Li@end 23*67e74705SXin Li 24*67e74705SXin Li@implementation INTF 25*67e74705SXin Li- (int) foo: (int)arg1 __attribute__((deprecated)){ 26*67e74705SXin Li return 10; 27*67e74705SXin Li} 28*67e74705SXin Li- (int) foo1: (int)arg1 { 29*67e74705SXin Li return 10; 30*67e74705SXin Li} 31*67e74705SXin Li- (int) foo2: (int)arg1 __attribute__((deprecated)) { 32*67e74705SXin Li return 10; 33*67e74705SXin Li} 34*67e74705SXin Li- (int) foo3: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)) __attribute__((ns_consumes_self)) {return 0; } 35*67e74705SXin Li- (void) dep __attribute__((deprecated)) { } // OK private methodn 36*67e74705SXin Li@end 37*67e74705SXin Li 38*67e74705SXin Li 39*67e74705SXin Li// rdar://10529259 40*67e74705SXin Li#define IBAction void)__attribute__((ibaction) 41*67e74705SXin Li 42*67e74705SXin Li@interface Foo 43*67e74705SXin Li- (void)doSomething1:(id)sender; 44*67e74705SXin Li- (void)doSomething2:(id)sender; 45*67e74705SXin Li@end 46*67e74705SXin Li 47*67e74705SXin Li@implementation Foo 48*67e74705SXin Li- (void)doSomething1:(id)sender{} 49*67e74705SXin Li- (void)doSomething2:(id)sender{} 50*67e74705SXin Li@end 51*67e74705SXin Li 52*67e74705SXin Li@interface Bar : Foo 53*67e74705SXin Li- (IBAction)doSomething1:(id)sender; 54*67e74705SXin Li@end 55*67e74705SXin Li@implementation Bar 56*67e74705SXin Li- (IBAction)doSomething1:(id)sender {} 57*67e74705SXin Li- (IBAction)doSomething2:(id)sender {} 58*67e74705SXin Li- (IBAction)doSomething3:(id)sender {} 59*67e74705SXin Li@end 60*67e74705SXin Li 61*67e74705SXin Li// rdar://11593375 62*67e74705SXin Li@interface NSObject @end 63*67e74705SXin Li 64*67e74705SXin Li@interface Test : NSObject 65*67e74705SXin Li-(id)method __attribute__((deprecated)); 66*67e74705SXin Li-(id)method1; 67*67e74705SXin Li-(id)method2 __attribute__((aligned(16))); 68*67e74705SXin Li- (id) method3: (int)arg1 __attribute__((aligned(16))) __attribute__((deprecated)) __attribute__((unavailable)); 69*67e74705SXin Li- (id) method4: (int)arg1 __attribute__((aligned(16))) __attribute__((deprecated)) __attribute__((unavailable)); 70*67e74705SXin Li@end 71*67e74705SXin Li 72*67e74705SXin Li@implementation Test 73*67e74705SXin Li-(id)method __attribute__((aligned(16))) __attribute__((aligned(16))) __attribute__((deprecated)) { 74*67e74705SXin Li return self; 75*67e74705SXin Li} 76*67e74705SXin Li-(id)method1 __attribute__((aligned(16))) { 77*67e74705SXin Li return self; 78*67e74705SXin Li} 79*67e74705SXin Li-(id)method2 { 80*67e74705SXin Li return self; 81*67e74705SXin Li} 82*67e74705SXin Li- (id) method3: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)) { 83*67e74705SXin Li return self; 84*67e74705SXin Li} 85*67e74705SXin Li- (id) method4: (int)arg1 __attribute__((aligned(16))) __attribute__((deprecated)) __attribute__((unavailable)) { 86*67e74705SXin Li return self; 87*67e74705SXin Li} 88*67e74705SXin Li@end 89*67e74705SXin Li 90*67e74705SXin Li__attribute__((cdecl)) // expected-warning {{'cdecl' attribute only applies to functions and methods}} 91*67e74705SXin Li@interface Complain 92*67e74705SXin Li@end 93*67e74705SXin Li 94*67e74705SXin Li// rdar://15450637 95*67e74705SXin Li@interface rdar15450637 : NSObject 96*67e74705SXin Li@property int p __attribute__((section("__TEXT,foo"))); 97*67e74705SXin Li 98*67e74705SXin Li- (id) IMethod :(int) count, ... __attribute__((section("__TEXT,foo"))); 99*67e74705SXin Li 100*67e74705SXin Li+ (void) CMethod : (id) Obj __attribute__((section("__TEXT,fee"))); 101*67e74705SXin Li@end 102