Fariborz Jahanian | 4b6df3f | 2007-10-04 00:22:33 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
Fariborz Jahanian | b27c156 | 2007-09-22 00:01:35 +0000 | [diff] [blame] | 3 | @interface MyClass1 @end |
| 4 | |
| 5 | @protocol p1,p2,p3; |
| 6 | |
Chris Lattner | 6ff0fc3 | 2008-11-23 22:38:38 +0000 | [diff] [blame] | 7 | @interface MyClass1 (Category1) <p1> // expected-warning {{cannot find protocol definition for 'p1'}} expected-note {{previous definition is here}} |
Fariborz Jahanian | b27c156 | 2007-09-22 00:01:35 +0000 | [diff] [blame] | 8 | @end |
| 9 | |
Chris Lattner | 6ff0fc3 | 2008-11-23 22:38:38 +0000 | [diff] [blame] | 10 | @interface MyClass1 (Category1) // expected-warning {{duplicate definition of category 'Category1' on interface 'MyClass1'}} |
Fariborz Jahanian | b27c156 | 2007-09-22 00:01:35 +0000 | [diff] [blame] | 11 | @end |
| 12 | |
| 13 | @interface MyClass1 (Category3) |
| 14 | @end |
| 15 | |
Chris Lattner | 6ff0fc3 | 2008-11-23 22:38:38 +0000 | [diff] [blame] | 16 | @interface MyClass1 (Category4) @end // expected-note {{previous definition is here}} |
Fariborz Jahanian | b27c156 | 2007-09-22 00:01:35 +0000 | [diff] [blame] | 17 | @interface MyClass1 (Category5) @end |
| 18 | @interface MyClass1 (Category6) @end |
Chris Lattner | 6ff0fc3 | 2008-11-23 22:38:38 +0000 | [diff] [blame] | 19 | @interface MyClass1 (Category7) @end // expected-note {{previous definition is here}} |
| 20 | @interface MyClass1 (Category8) @end // expected-note {{previous definition is here}} |
Fariborz Jahanian | b27c156 | 2007-09-22 00:01:35 +0000 | [diff] [blame] | 21 | |
| 22 | |
Chris Lattner | 6ff0fc3 | 2008-11-23 22:38:38 +0000 | [diff] [blame] | 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'}} |
Fariborz Jahanian | b27c156 | 2007-09-22 00:01:35 +0000 | [diff] [blame] | 26 | |
| 27 | |
| 28 | @protocol p3 @end |
| 29 | |
Chris Lattner | eacc392 | 2008-07-26 03:47:43 +0000 | [diff] [blame] | 30 | @interface MyClass1 (Category) <p2, p3> @end // expected-warning {{cannot find protocol definition for 'p2'}} |
Fariborz Jahanian | b27c156 | 2007-09-22 00:01:35 +0000 | [diff] [blame] | 31 | |
| 32 | @interface MyClass (Category) @end // expected-error {{cannot find interface declaration for 'MyClass'}} |
| 33 | |
| 34 | @class MyClass2; |
| 35 | |
| 36 | @interface MyClass2 (Category) @end // expected-error {{cannot find interface declaration for 'MyClass2'}} |
| 37 | |
Steve Naroff | 74199b6 | 2008-06-05 04:33:44 +0000 | [diff] [blame] | 38 | @interface XCRemoteComputerManager |
| 39 | @end |
| 40 | |
| 41 | @interface XCRemoteComputerManager() |
| 42 | @end |
| 43 | |
| 44 | @interface XCRemoteComputerManager() |
| 45 | @end |
| 46 | |
Chris Lattner | 6ff0fc3 | 2008-11-23 22:38:38 +0000 | [diff] [blame] | 47 | @interface XCRemoteComputerManager(x) // expected-note {{previous definition is here}} |
Steve Naroff | 74199b6 | 2008-06-05 04:33:44 +0000 | [diff] [blame] | 48 | @end |
| 49 | |
Chris Lattner | 6ff0fc3 | 2008-11-23 22:38:38 +0000 | [diff] [blame] | 50 | @interface XCRemoteComputerManager(x) // expected-warning {{duplicate definition of category 'x' on interface 'XCRemoteComputerManager'}} |
Steve Naroff | 74199b6 | 2008-06-05 04:33:44 +0000 | [diff] [blame] | 51 | @end |
| 52 | |
| 53 | @implementation XCRemoteComputerManager |
| 54 | @end |
| 55 | |
Fariborz Jahanian | b27c156 | 2007-09-22 00:01:35 +0000 | [diff] [blame] | 56 | |