blob: a560e7432fc47c7a4c54e24595eb66150161e79f [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -verify -fsyntax-only %s
Daniel Dunbar35682492008-09-26 04:12:28 +00002
3@class NSString;
4
5@interface A
6-t1 __attribute__((noreturn));
7- (NSString *)stringByAppendingFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2)));
Daniel Dunbard3f2c102008-10-19 02:04:16 +00008-(void) m0 __attribute__((noreturn));
9-(void) m1 __attribute__((unused));
Daniel Dunbar35682492008-09-26 04:12:28 +000010@end
Fariborz Jahanian5d36ac22009-05-12 21:36:23 +000011
12
13@interface INTF
14- (int) foo1: (int)arg1 __attribute__((deprecated));
15
16- (int) foo: (int)arg1;
17
18- (int) foo2: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable));
Fariborz Jahanian7fda4002011-10-22 01:21:15 +000019- (int) foo3: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)) __attribute__((ns_consumes_self));
Fariborz Jahanian5d36ac22009-05-12 21:36:23 +000020@end
21
22@implementation INTF
Fariborz Jahanianee28a4b2011-10-22 01:56:45 +000023- (int) foo: (int)arg1 __attribute__((deprecated)){ // expected-warning {{method attribute can only be specified}}
Fariborz Jahanian5d36ac22009-05-12 21:36:23 +000024 return 10;
25}
26- (int) foo1: (int)arg1 {
27 return 10;
28}
Fariborz Jahanian09d04e52009-05-13 00:47:33 +000029- (int) foo2: (int)arg1 __attribute__((deprecated)) { // expected-warning {{method attribute can only be specified}}
Fariborz Jahanian5d36ac22009-05-12 21:36:23 +000030 return 10;
31}
Fariborz Jahanian7fda4002011-10-22 01:21:15 +000032- (int) foo3: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)) __attribute__((ns_consumes_self)) {return 0; }
33- (void) dep __attribute__((deprecated)) { } // OK private methodn
Fariborz Jahanian5d36ac22009-05-12 21:36:23 +000034@end
35