Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Fariborz Jahanian | 4b6df3f | 2007-10-04 00:22:33 +0000 | [diff] [blame] | 2 | |
Fariborz Jahanian | ccb4f31 | 2007-09-25 18:38:09 +0000 | [diff] [blame] | 3 | @protocol SUPER; |
| 4 | |
Chris Lattner | eacc392 | 2008-07-26 03:47:43 +0000 | [diff] [blame] | 5 | @interface SUPER <SUPER> @end // expected-warning {{cannot find protocol definition for 'SUPER'}} |
Fariborz Jahanian | ccb4f31 | 2007-09-25 18:38:09 +0000 | [diff] [blame] | 6 | |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 7 | typedef int INTF; // expected-note {{previous definition is here}} |
Fariborz Jahanian | ccb4f31 | 2007-09-25 18:38:09 +0000 | [diff] [blame] | 8 | |
| 9 | @interface INTF @end // expected-error {{redefinition of 'INTF' as different kind of symbol}} |
| 10 | |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 11 | @interface OBJECT @end // expected-note {{previous definition is here}} |
Fariborz Jahanian | ccb4f31 | 2007-09-25 18:38:09 +0000 | [diff] [blame] | 12 | |
Chris Lattner | b8b96af | 2008-11-23 22:46:27 +0000 | [diff] [blame] | 13 | @interface INTF1 : OBJECT @end // expected-note {{previous definition is here}} |
Fariborz Jahanian | ccb4f31 | 2007-09-25 18:38:09 +0000 | [diff] [blame] | 14 | |
Chris Lattner | b8b96af | 2008-11-23 22:46:27 +0000 | [diff] [blame] | 15 | @interface INTF1 : OBJECT @end // expected-error {{duplicate interface definition for class 'INTF1'}} |
Fariborz Jahanian | ccb4f31 | 2007-09-25 18:38:09 +0000 | [diff] [blame] | 16 | |
Douglas Gregor | cda9c67 | 2009-02-16 17:45:42 +0000 | [diff] [blame] | 17 | typedef int OBJECT; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}} |
Fariborz Jahanian | ccb4f31 | 2007-09-25 18:38:09 +0000 | [diff] [blame] | 18 | |
Douglas Gregor | cda9c67 | 2009-02-16 17:45:42 +0000 | [diff] [blame] | 19 | typedef int OBJECT2; // expected-note {{previous definition is here}} |
| 20 | @interface INTF2 : OBJECT2 @end // expected-error {{redefinition of 'OBJECT2' as different kind of symbol}} |
Fariborz Jahanian | ccb4f31 | 2007-09-25 18:38:09 +0000 | [diff] [blame] | 21 | |
| 22 | |
| 23 | @protocol PROTO; |
| 24 | |
| 25 | @interface INTF3 : PROTO @end // expected-error {{cannot find interface declaration for 'PROTO', superclass of 'INTF3'}} |
| 26 | |
Steve Naroff | 818cb9e | 2009-02-04 17:14:05 +0000 | [diff] [blame] | 27 | // Make sure we allow the following (for GCC compatibility). |
| 28 | @interface NSObject @end |
| 29 | typedef NSObject TD_NSObject; |
| 30 | @interface XCElementUnit : TD_NSObject {} |
| 31 | @end |
| 32 | |
| 33 | |