[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / SemaObjC / check-dup-objc-decls-1.m
blob8dde777f7437d7d8ac5dba07142a795e2811ada6
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 @interface Foo // expected-note {{previous definition is here}}
4 @end
6 float Foo;      // expected-error {{redefinition of 'Foo' as different kind of symbol}}
8 @class Bar;  // expected-note {{previous definition is here}}
10 typedef int Bar;  // expected-error {{redefinition of 'Bar' as different kind of symbol}}
12 @implementation FooBar // expected-warning {{cannot find interface declaration for 'FooBar'}} 
13 @end
16 typedef int OBJECT; // expected-note {{previous definition is here}}
18 @class OBJECT ; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
21 typedef int Gorf;  // expected-note {{previous definition is here}}
23 @interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}} expected-note {{previous definition is here}}
25 void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
27   int Bar, Foo, FooBar;
30 @protocol P -im1; @end
31 @protocol Q -im2; @end
32 @interface A<P> @end  // expected-note {{previous definition is here}}
33 @interface A<Q> @end  // expected-error {{duplicate interface definition for class 'A'}}
35 @protocol PP<P> @end  // expected-note {{previous definition is here}}
36 @protocol PP<Q> @end  // expected-warning {{duplicate protocol definition of 'PP'}}
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'}}
41 // rdar 7626768
42 @class NSString;
43 NSString * TestBaz;  // expected-note {{previous definition is here}}
44 NSString * const TestBaz;  // expected-error {{redefinition of 'TestBaz' with a different type}}