1 // RUN: %clang_cc1 -triple i386-unknown-unknown -verify -fsyntax-only -Wno-objc-root-class %s
6 -t1 __attribute__((noreturn));
7 - (NSString *)stringByAppendingFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2)));
8 -(void) m0 __attribute__((noreturn));
9 -(void) m1 __attribute__((unused));
10 -(void) m2 __attribute__((stdcall));
11 -(void) m3 __attribute__((optnone));
16 - (int) foo1: (int)arg1 __attribute__((deprecated));
18 - (int) foo: (int)arg1;
20 - (int) foo2: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable));
21 - (int) foo3: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)) __attribute__((ns_consumes_self));
25 - (int) foo: (int)arg1 __attribute__((deprecated)){
28 - (int) foo1: (int)arg1 {
31 - (int) foo2: (int)arg1 __attribute__((deprecated)) {
34 - (int) foo3: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)) __attribute__((ns_consumes_self)) {return 0; }
35 - (void) dep __attribute__((deprecated)) { } // OK private methodn
39 - (void)doSomething1:(id)sender;
40 - (void)doSomething2:(id)sender;
44 - (void)doSomething1:(id)sender{}
45 - (void)doSomething2:(id)sender{}
49 - (IBAction)doSomething1:(id)sender;
52 - (IBAction)doSomething1:(id)sender {}
53 - (IBAction)doSomething2:(id)sender {}
54 - (IBAction)doSomething3:(id)sender {}
57 @interface NSObject @end
59 @interface Test : NSObject
60 -(id)method __attribute__((deprecated));
62 -(id)method2 __attribute__((aligned(16)));
63 - (id) method3: (int)arg1 __attribute__((aligned(16))) __attribute__((deprecated)) __attribute__((unavailable));
64 - (id) method4: (int)arg1 __attribute__((aligned(16))) __attribute__((deprecated)) __attribute__((unavailable));
68 -(id)method __attribute__((aligned(16))) __attribute__((aligned(16))) __attribute__((deprecated)) {
71 -(id)method1 __attribute__((aligned(16))) {
77 - (id) method3: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable)) {
80 - (id) method4: (int)arg1 __attribute__((aligned(16))) __attribute__((deprecated)) __attribute__((unavailable)) {
85 __attribute__((cdecl)) // expected-warning {{'cdecl' attribute only applies to functions and methods}}
89 @interface rdar15450637 : NSObject
90 @property int p __attribute__((section("__TEXT,foo")));
92 - (id) IMethod :(int) count, ... __attribute__((section("__TEXT,foo")));
94 + (void) CMethod : (id) Obj __attribute__((section("__TEXT,fee")));
97 // Section type conflicts between methods/properties and global variables
98 const int global1 __attribute__((section("seg1,sec1"))) = 10; // expected-note {{declared here}} expected-note {{declared here}} expected-note {{declared here}}
99 int global2 __attribute__((section("seg2,sec2"))) = 10; // expected-note {{declared here}} expected-note {{declared here}} expected-note {{declared here}}
101 @interface section_conflicts : NSObject
102 @property int p1 __attribute__((section("seg1,sec1"))); // expected-error {{'p1' causes a section type conflict with 'global1'}}
103 @property int p2 __attribute__((section("seg2,sec2"))); // expected-error {{'p2' causes a section type conflict with 'global2'}}
105 - (void)imethod1 __attribute__((section("seg1,sec1"))); // expected-error {{'imethod1' causes a section type conflict with 'global1'}}
106 - (void)imethod2 __attribute__((section("seg2,sec2"))); // expected-error {{'imethod2' causes a section type conflict with 'global2'}}
108 + (void)cmethod1:(id)Obj __attribute__((section("seg1,sec1"))); // expected-error {{'cmethod1:' causes a section type conflict with 'global1'}}
109 + (void)cmethod2:(id)Obj __attribute__((section("seg2,sec2"))); // expected-error {{'cmethod2:' causes a section type conflict with 'global2'}}