blob: 1dfaf0905083c1a0e4a590cc4b67fe8541e523fa [file] [log] [blame]
Daniel Dunbarffd408a2009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Fariborz Jahaniand4e36e42007-10-15 19:16:57 +00002
Chris Lattner1336cab2008-11-23 23:12:31 +00003@interface Foo // expected-note {{previous definition is here}}
Fariborz Jahaniand4e36e42007-10-15 19:16:57 +00004@end
5
6float Foo; // expected-error {{redefinition of 'Foo' as different kind of symbol}}
7
Chris Lattner1336cab2008-11-23 23:12:31 +00008@class Bar; // expected-note {{previous definition is here}}
Fariborz Jahaniand4e36e42007-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 Lattner1336cab2008-11-23 23:12:31 +000016typedef int OBJECT; // expected-note {{previous definition is here}}
Fariborz Jahaniand4e36e42007-10-15 19:16:57 +000017
18@class OBJECT ; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
19
20
Steve Naroff104956f2009-04-23 15:15:40 +000021typedef int Gorf; // expected-note {{previous definition is here}}
Fariborz Jahaniand4e36e42007-10-15 19:16:57 +000022
Steve Naroff104956f2009-04-23 15:15:40 +000023@interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}} expected-note {{previous definition is here}}
Fariborz Jahaniand4e36e42007-10-15 19:16:57 +000024
25void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
26{
Sebastian Redlebfa23a2009-02-07 19:52:04 +000027 int Bar, Foo, FooBar;
Fariborz Jahaniand4e36e42007-10-15 19:16:57 +000028}
Steve Naroff1422a622008-11-18 19:15:30 +000029
30@protocol P -im1; @end
31@protocol Q -im2; @end
Chris Lattner5b250652008-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 Naroff1422a622008-11-18 19:15:30 +000034
Chris Lattner5b250652008-11-23 22:46:27 +000035@protocol PP<P> @end // expected-note {{previous definition is here}}
Fariborz Jahanian68199552009-04-06 23:43:32 +000036@protocol PP<Q> @end // expected-warning {{duplicate protocol definition of 'PP'}}
Steve Naroff1422a622008-11-18 19:15:30 +000037
Chris Lattnerde1bd982008-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'}}