Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Fariborz Jahanian | 4b6df3f | 2007-10-04 00:22:33 +0000 | [diff] [blame] | 2 | |
Fariborz Jahanian | d0b90bf | 2007-09-26 18:27:25 +0000 | [diff] [blame] | 3 | @interface INTF |
| 4 | { |
| 5 | @public |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 6 | int IVAR; // expected-note {{previous definition is here}} |
Fariborz Jahanian | d0b90bf | 2007-09-26 18:27:25 +0000 | [diff] [blame] | 7 | } |
| 8 | @end |
| 9 | |
| 10 | @implementation INTF |
| 11 | { |
| 12 | @private |
| 13 | |
Chris Lattner | 08631c5 | 2008-11-23 21:45:46 +0000 | [diff] [blame] | 14 | int XIVAR; // expected-error {{conflicting instance variable names: 'XIVAR' vs 'IVAR'}} |
Fariborz Jahanian | d0b90bf | 2007-09-26 18:27:25 +0000 | [diff] [blame] | 15 | } |
| 16 | @end |
| 17 | |
| 18 | |
| 19 | |
| 20 | @interface INTF1 |
| 21 | { |
| 22 | @public |
| 23 | int IVAR; |
Fariborz Jahanian | 4319b84 | 2007-12-13 00:16:34 +0000 | [diff] [blame] | 24 | int IVAR1; // expected-error {{inconsistent number of instance variables specified}} |
Fariborz Jahanian | d0b90bf | 2007-09-26 18:27:25 +0000 | [diff] [blame] | 25 | } |
| 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 Jahanian | 4319b84 | 2007-12-13 00:16:34 +0000 | [diff] [blame] | 49 | int IVAR1; // expected-error {{inconsistent number of instance variables specified}} |
Fariborz Jahanian | d0b90bf | 2007-09-26 18:27:25 +0000 | [diff] [blame] | 50 | } |
| 51 | @end |
| 52 | |
| 53 | |
| 54 | @interface INTF3 |
| 55 | { |
| 56 | @public |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 57 | int IVAR; // expected-note {{previous definition is here}} |
Fariborz Jahanian | d0b90bf | 2007-09-26 18:27:25 +0000 | [diff] [blame] | 58 | } |
| 59 | @end |
| 60 | |
| 61 | @implementation INTF3 |
| 62 | { |
| 63 | @private |
| 64 | |
Chris Lattner | 08631c5 | 2008-11-23 21:45:46 +0000 | [diff] [blame] | 65 | short IVAR; // expected-error {{instance variable 'IVAR' has conflicting type: 'short' vs 'int'}} |
Fariborz Jahanian | d0b90bf | 2007-09-26 18:27:25 +0000 | [diff] [blame] | 66 | } |
| 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 |