]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaObjC/category-1.m
Update clang to r93512.
[FreeBSD/FreeBSD.git] / test / SemaObjC / category-1.m
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2
3 @interface MyClass1 @end
4
5 @protocol p1,p2,p3;
6
7 @interface MyClass1 (Category1)  <p1> // expected-warning {{cannot find protocol definition for 'p1'}} expected-note {{previous definition is here}}
8 @end
9
10 @interface MyClass1 (Category1)  // expected-warning {{duplicate definition of category 'Category1' on interface 'MyClass1'}}
11 @end
12
13 @interface MyClass1 (Category3) 
14 @end
15
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}}
21
22
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'}}
26
27
28 @protocol p3 @end
29
30 @interface MyClass1 (Category) <p2, p3> @end  // expected-warning {{cannot find protocol definition for 'p2'}}
31
32 @interface UnknownClass  (Category) @end // expected-error {{cannot find interface declaration for 'UnknownClass'}}
33
34 @class MyClass2;
35
36 @interface MyClass2  (Category) @end  // expected-error {{cannot find interface declaration for 'MyClass2'}}
37
38 @interface XCRemoteComputerManager
39 @end
40
41 @interface XCRemoteComputerManager() 
42 @end 
43
44 @interface XCRemoteComputerManager()
45 @end
46
47 @interface XCRemoteComputerManager(x) // expected-note {{previous definition is here}}
48 @end 
49
50 @interface XCRemoteComputerManager(x) // expected-warning {{duplicate definition of category 'x' on interface 'XCRemoteComputerManager'}}
51 @end
52
53 @implementation XCRemoteComputerManager
54 @end
55
56 @implementation XCRemoteComputerManager(x) // expected-note {{previous definition is here}}
57 @end
58
59 @implementation XCRemoteComputerManager(x) // expected-error {{reimplementation of category 'x' for class 'XCRemoteComputerManager'}}
60 @end
61
62 // <rdar://problem/7249233>
63
64 @protocol MultipleCat_P
65 -(void) im0;
66 @end
67
68 @interface MultipleCat_I @end
69
70 @interface MultipleCat_I()  @end
71
72 @interface MultipleCat_I() <MultipleCat_P>  @end
73
74 @implementation MultipleCat_I // expected-warning {{incomplete implementation}}, expected-warning {{method definition for 'im0' not found}}
75 @end