[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / SemaObjC / category-1.m
blob4cc5dafaa91b4c7d06b2a2ea8e18a063c90da72f
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 @interface MyClass1 @end
5 @protocol p1,p2,p3;
7 @interface MyClass1 (Category1)  <p1> // expected-warning {{cannot find protocol definition for 'p1'}} expected-note {{previous definition is here}}
8 @end
10 @interface MyClass1 (Category1)  // expected-warning {{duplicate definition of category 'Category1' on interface 'MyClass1'}}
11 @end
13 @interface MyClass1 (Category3) 
14 @end
16 @interface MyClass1 (Category4) @end // expected-note {{previous definition is here}}
17 @interface MyClass1 (Category5) @end
18 @interface MyClass1 (Category6) @end
19 @interface MyClass1 (Category7) @end // expected-note {{previous definition is here}}
20 @interface MyClass1 (Category8) @end // expected-note {{previous definition is here}}
23 @interface MyClass1 (Category4) @end // expected-warning {{duplicate definition of category 'Category4' on interface 'MyClass1'}}
24 @interface MyClass1 (Category7) @end // expected-warning {{duplicate definition of category 'Category7' on interface 'MyClass1'}}
25 @interface MyClass1 (Category8) @end // expected-warning {{duplicate definition of category 'Category8' on interface 'MyClass1'}}
28 @protocol p3 @end
30 @interface MyClass1 (Category) <p2, p3> @end  // expected-warning {{cannot find protocol definition for 'p2'}}
32 @interface UnknownClass  (Category) @end // expected-error {{cannot find interface declaration for 'UnknownClass'}}
34 @class MyClass2;
36 @interface MyClass2  (Category) @end  // expected-error {{cannot find interface declaration for 'MyClass2'}}
38 @interface XCRemoteComputerManager
39 @end
41 @interface XCRemoteComputerManager() 
42 @end 
44 @interface XCRemoteComputerManager()
45 @end
47 @interface XCRemoteComputerManager(x) // expected-note {{previous definition is here}}
48 @end 
50 @interface XCRemoteComputerManager(x) // expected-warning {{duplicate definition of category 'x' on interface 'XCRemoteComputerManager'}}
51 @end
53 @implementation XCRemoteComputerManager
54 @end
56 @implementation XCRemoteComputerManager(x) // expected-note {{previous definition is here}}
57 @end
59 @implementation XCRemoteComputerManager(x) // expected-error {{reimplementation of category 'x' for class 'XCRemoteComputerManager'}}
60 @end
62 // <rdar://problem/7249233>
64 @protocol MultipleCat_P
65 -(void) im0; // expected-note {{method declared here}}
66 @end
68 @interface MultipleCat_I @end // expected-note {{required for direct or indirect protocol 'MultipleCat_P'}}
70 @interface MultipleCat_I()  @end
72 @interface MultipleCat_I() <MultipleCat_P>  @end
74 @implementation MultipleCat_I // expected-warning {{incomplete implementation}} \
75                               // expected-warning {{method in protocol not implemented [-Wprotocol]}}
76 @end
78 // <rdar://problem/7680391> - Handle nameless categories with no name that refer
79 // to an undefined class
80 @interface RDar7680391 () @end // expected-error{{cannot find interface declaration}}
82 // <rdar://problem/8891119> - Handle @synthesize being used in conjunction
83 // with explicitly declared accessor.
84 @interface RDar8891119 {
85   id _name;
87 @end
88 @interface RDar8891119 ()
89 - (id)name;
90 @end
91 @interface RDar8891119 ()
92 @property (copy) id name;
93 @end
94 @implementation RDar8891119
95 @synthesize name = _name;
96 @end