blob: 3f27b2c1772b5526083eb581c4e20f00878ed425 [file] [log] [blame]
Fariborz Jahanian4b6df3f2007-10-04 00:22:33 +00001// RUN: clang -fsyntax-only -verify %s
2
Fariborz Jahaniand0b90bf2007-09-26 18:27:25 +00003@interface INTF
4{
5@public
Chris Lattner5f4a6822008-11-23 23:12:31 +00006 int IVAR; // expected-note {{previous definition is here}}
Fariborz Jahaniand0b90bf2007-09-26 18:27:25 +00007}
8@end
9
10@implementation INTF
11{
12@private
13
Chris Lattner08631c52008-11-23 21:45:46 +000014 int XIVAR; // expected-error {{conflicting instance variable names: 'XIVAR' vs 'IVAR'}}
Fariborz Jahaniand0b90bf2007-09-26 18:27:25 +000015}
16@end
17
18
19
20@interface INTF1
21{
22@public
23 int IVAR;
Fariborz Jahanian4319b842007-12-13 00:16:34 +000024 int IVAR1; // expected-error {{inconsistent number of instance variables specified}}
Fariborz Jahaniand0b90bf2007-09-26 18:27:25 +000025}
26@end
27
28@implementation INTF1
29{
30@private
31
32 int IVAR;
33}
34@end
35
36
37@interface INTF2
38{
39@public
40 int IVAR;
41}
42@end
43
44@implementation INTF2
45{
46@private
47
48 int IVAR;
Fariborz Jahanian4319b842007-12-13 00:16:34 +000049 int IVAR1; // expected-error {{inconsistent number of instance variables specified}}
Fariborz Jahaniand0b90bf2007-09-26 18:27:25 +000050}
51@end
52
53
54@interface INTF3
55{
56@public
Chris Lattner5f4a6822008-11-23 23:12:31 +000057 int IVAR; // expected-note {{previous definition is here}}
Fariborz Jahaniand0b90bf2007-09-26 18:27:25 +000058}
59@end
60
61@implementation INTF3
62{
63@private
64
Chris Lattner08631c52008-11-23 21:45:46 +000065 short IVAR; // expected-error {{instance variable 'IVAR' has conflicting type: 'short' vs 'int'}}
Fariborz Jahaniand0b90bf2007-09-26 18:27:25 +000066}
67@end
68
69@implementation INTF4 // expected-warning {{cannot find interface declaration for 'INTF4'}}
70{
71@private
72
73 short IVAR;
74}
75@end
76
77@interface INTF5
78{
79 char * ch;
80}
81@end
82
83@implementation INTF5
84{
85}
86@end