blob: 5f55cfdb27164d86b5ca1f505ab3d45f118cd6e8 [file] [log] [blame]
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +00001// RUN: clang -fsyntax-only -verify %s
Chris Lattner08631c52008-11-23 21:45:46 +00002// XFAIL
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +00003
4@interface Foo // expected-error {{previous definition is here}}
5@end
6
7float Foo; // expected-error {{redefinition of 'Foo' as different kind of symbol}}
8
9@class Bar; // expected-error {{previous definition is here}}
10
11typedef int Bar; // expected-error {{redefinition of 'Bar' as different kind of symbol}}
12
13@implementation FooBar // expected-warning {{cannot find interface declaration for 'FooBar'}}
14@end
15
16
17typedef int OBJECT; // expected-error {{previous definition is here}}
18
19@class OBJECT ; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
20
21
22typedef int Gorf; // expected-error {{previous definition is here}}
23
Steve Naroff31102512008-04-02 18:30:49 +000024@interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
Fariborz Jahanianbe127ba2007-10-15 19:16:57 +000025
26void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
27{
28 int Bar, Foo, FooBar;
29}
Steve Naroffcfe8bf32008-11-18 19:15:30 +000030
31@protocol P -im1; @end
32@protocol Q -im2; @end
33@interface A<P> @end
34@interface A<Q> @end // expected-error {{duplicate interface declaration for class 'A'}}
35
36@protocol PP<P> @end
37@protocol PP<Q> @end // expected-error {{duplicate protocol declaration of 'PP'}}
38
39@interface A(Cat)<P> @end
40@interface A(Cat)<Q> @end // expected-warning {{duplicate interface declaration for category 'A(Cat)'}}