Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Fariborz Jahanian | be127ba | 2007-10-15 19:16:57 +0000 | [diff] [blame] | 2 | |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 3 | @interface Foo // expected-note {{previous definition is here}} |
Fariborz Jahanian | be127ba | 2007-10-15 19:16:57 +0000 | [diff] [blame] | 4 | @end |
| 5 | |
| 6 | float Foo; // expected-error {{redefinition of 'Foo' as different kind of symbol}} |
| 7 | |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 8 | @class Bar; // expected-note {{previous definition is here}} |
Fariborz Jahanian | be127ba | 2007-10-15 19:16:57 +0000 | [diff] [blame] | 9 | |
| 10 | typedef int Bar; // expected-error {{redefinition of 'Bar' as different kind of symbol}} |
| 11 | |
| 12 | @implementation FooBar // expected-warning {{cannot find interface declaration for 'FooBar'}} |
| 13 | @end |
| 14 | |
| 15 | |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 16 | typedef int OBJECT; // expected-note {{previous definition is here}} |
Fariborz Jahanian | be127ba | 2007-10-15 19:16:57 +0000 | [diff] [blame] | 17 | |
| 18 | @class OBJECT ; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}} |
| 19 | |
| 20 | |
Steve Naroff | a7503a7 | 2009-04-23 15:15:40 +0000 | [diff] [blame] | 21 | typedef int Gorf; // expected-note {{previous definition is here}} |
Fariborz Jahanian | be127ba | 2007-10-15 19:16:57 +0000 | [diff] [blame] | 22 | |
Steve Naroff | a7503a7 | 2009-04-23 15:15:40 +0000 | [diff] [blame] | 23 | @interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}} expected-note {{previous definition is here}} |
Fariborz Jahanian | be127ba | 2007-10-15 19:16:57 +0000 | [diff] [blame] | 24 | |
| 25 | void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}} |
| 26 | { |
Sebastian Redl | 3cb0692 | 2009-02-07 19:52:04 +0000 | [diff] [blame] | 27 | int Bar, Foo, FooBar; |
Fariborz Jahanian | be127ba | 2007-10-15 19:16:57 +0000 | [diff] [blame] | 28 | } |
Steve Naroff | cfe8bf3 | 2008-11-18 19:15:30 +0000 | [diff] [blame] | 29 | |
| 30 | @protocol P -im1; @end |
| 31 | @protocol Q -im2; @end |
Chris Lattner | b8b96af | 2008-11-23 22:46:27 +0000 | [diff] [blame] | 32 | @interface A<P> @end // expected-note {{previous definition is here}} |
| 33 | @interface A<Q> @end // expected-error {{duplicate interface definition for class 'A'}} |
Steve Naroff | cfe8bf3 | 2008-11-18 19:15:30 +0000 | [diff] [blame] | 34 | |
Chris Lattner | b8b96af | 2008-11-23 22:46:27 +0000 | [diff] [blame] | 35 | @protocol PP<P> @end // expected-note {{previous definition is here}} |
Fariborz Jahanian | e2573e5 | 2009-04-06 23:43:32 +0000 | [diff] [blame] | 36 | @protocol PP<Q> @end // expected-warning {{duplicate protocol definition of 'PP'}} |
Steve Naroff | cfe8bf3 | 2008-11-18 19:15:30 +0000 | [diff] [blame] | 37 | |
Chris Lattner | 6ff0fc3 | 2008-11-23 22:38:38 +0000 | [diff] [blame] | 38 | @interface A(Cat)<P> @end // expected-note {{previous definition is here}} |
| 39 | @interface A(Cat)<Q> @end // expected-warning {{duplicate definition of category 'Cat' on interface 'A'}} |