blob: da8a3267662f632caac6a2acb17edfc6e040ca01 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Fariborz Jahanian4b6df3f2007-10-04 00:22:33 +00002
Fariborz Jahanianccb4f312007-09-25 18:38:09 +00003@protocol SUPER;
4
Chris Lattnereacc3922008-07-26 03:47:43 +00005@interface SUPER <SUPER> @end // expected-warning {{cannot find protocol definition for 'SUPER'}}
Fariborz Jahanianccb4f312007-09-25 18:38:09 +00006
Chris Lattner5f4a6822008-11-23 23:12:31 +00007typedef int INTF; // expected-note {{previous definition is here}}
Fariborz Jahanianccb4f312007-09-25 18:38:09 +00008
9@interface INTF @end // expected-error {{redefinition of 'INTF' as different kind of symbol}}
10
Chris Lattner5f4a6822008-11-23 23:12:31 +000011@interface OBJECT @end // expected-note {{previous definition is here}}
Fariborz Jahanianccb4f312007-09-25 18:38:09 +000012
Chris Lattnerb8b96af2008-11-23 22:46:27 +000013@interface INTF1 : OBJECT @end // expected-note {{previous definition is here}}
Fariborz Jahanianccb4f312007-09-25 18:38:09 +000014
Chris Lattnerb8b96af2008-11-23 22:46:27 +000015@interface INTF1 : OBJECT @end // expected-error {{duplicate interface definition for class 'INTF1'}}
Fariborz Jahanianccb4f312007-09-25 18:38:09 +000016
Douglas Gregorcda9c672009-02-16 17:45:42 +000017typedef int OBJECT; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
Fariborz Jahanianccb4f312007-09-25 18:38:09 +000018
Douglas Gregorcda9c672009-02-16 17:45:42 +000019typedef int OBJECT2; // expected-note {{previous definition is here}}
20@interface INTF2 : OBJECT2 @end // expected-error {{redefinition of 'OBJECT2' as different kind of symbol}}
Fariborz Jahanianccb4f312007-09-25 18:38:09 +000021
22
23@protocol PROTO;
24
25@interface INTF3 : PROTO @end // expected-error {{cannot find interface declaration for 'PROTO', superclass of 'INTF3'}}
26
Steve Naroff818cb9e2009-02-04 17:14:05 +000027// Make sure we allow the following (for GCC compatibility).
28@interface NSObject @end
29typedef NSObject TD_NSObject;
30@interface XCElementUnit : TD_NSObject {}
31@end
32
33