blob: fa9b8674be0dd55960f07fb3e957adfb1fb3b1c9 [file] [log] [blame]
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +00001// RUN: clang -fsyntax-only -verify %s
2
Chris Lattner5f4a6822008-11-23 23:12:31 +00003@interface Foo // expected-note {{previous definition is here}}
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +00004@end
5
6float Foo; // expected-error {{redefinition of 'Foo' as different kind of symbol}}
7
Chris Lattner5f4a6822008-11-23 23:12:31 +00008@class Bar; // expected-note {{previous definition is here}}
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +00009
10typedef 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 Lattner5f4a6822008-11-23 23:12:31 +000016typedef int OBJECT; // expected-note {{previous definition is here}}
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +000017
18@class OBJECT ; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
19
20
Chris Lattner5f4a6822008-11-23 23:12:31 +000021typedef int Gorf; // expected-note {{previous definition is here}}
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +000022
Steve Naroff31102512008-04-02 18:30:49 +000023@interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +000024
25void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
26{
27 int Bar, Foo, FooBar;
28}
Steve Naroffcfe8bf32008-11-18 19:15:30 +000029
30@protocol P -im1; @end
31@protocol Q -im2; @end
Chris Lattnerb8b96af2008-11-23 22:46:27 +000032@interface A<P> @end // expected-note {{previous definition is here}}
33@interface A<Q> @end // expected-error {{duplicate interface definition for class 'A'}}
Steve Naroffcfe8bf32008-11-18 19:15:30 +000034
Chris Lattnerb8b96af2008-11-23 22:46:27 +000035@protocol PP<P> @end // expected-note {{previous definition is here}}
36@protocol PP<Q> @end // expected-error {{duplicate protocol definition of 'PP'}}
Steve Naroffcfe8bf32008-11-18 19:15:30 +000037
Chris Lattner6ff0fc32008-11-23 22:38:38 +000038@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'}}