blob: dc9c8f442616754768d8d382fc8130ac36becb83 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +00002
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
Sebastian Redl3cb06922009-02-07 19:52:04 +000021typedef int Gorf; // expected-note 2 {{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{
Sebastian Redl3cb06922009-02-07 19:52:04 +000027 int Bar, Foo, FooBar;
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +000028}
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}}
Fariborz Jahaniane2573e52009-04-06 23:43:32 +000036@protocol PP<Q> @end // expected-warning {{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'}}