Daniel Dunbar | 69667a0 | 2009-04-21 16:03:31 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -triple x86_64-apple-darwin9 -fsyntax-only %s |
Daniel Dunbar | ff89666 | 2009-04-21 15:48:54 +0000 | [diff] [blame] | 2 | |
| 3 | @class I0; |
| 4 | // FIXME: Reject sizeof on incomplete interface; this breaks the test! |
| 5 | //int g0 = sizeof(I0); // exxpected-error{{invalid application of 'sizeof' to an incomplete type ...}} |
| 6 | |
| 7 | @interface I0 { |
| 8 | char x[4]; |
| 9 | } |
| 10 | |
| 11 | @property int p0; |
| 12 | @end |
| 13 | |
| 14 | // size == 4 |
| 15 | int g1[ sizeof(I0) == 4 ? 1 : -1]; |
| 16 | |
| 17 | @implementation I0 |
| 18 | @synthesize p0 = _p0; |
| 19 | @end |
| 20 | |
| 21 | // size == 4 (we do not include extended properties in the |
| 22 | // sizeof). |
| 23 | int g2[ sizeof(I0) == 4 ? 1 : -1]; |
| 24 | |
| 25 | @interface I1 |
| 26 | @property int p0; |
| 27 | @end |
| 28 | |
| 29 | @implementation I1 |
| 30 | @synthesize p0 = _p0; |
| 31 | @end |
| 32 | |
| 33 | // FIXME: This is currently broken due to the way the record layout we |
| 34 | // create is tied to whether we have seen synthesized properties. Ugh. |
| 35 | // int g3[ sizeof(I1) == 0 ? 1 : -1]; |