blob: 9ed63a7406ec66500f6da8a6938974dfbad1da8a [file] [log] [blame]
Daniel Dunbar69667a02009-04-21 16:03:31 +00001// RUN: clang-cc -triple x86_64-apple-darwin9 -fsyntax-only %s
Daniel Dunbarff896662009-04-21 15:48:54 +00002
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
15int 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).
23int 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];