blob: 78ce63cd52998626f078041a14a6c605fe8ccd10 [file] [log] [blame]
Daniel Dunbar5bd09392009-04-21 21:17:29 +00001// RUN: clang-cc -triple i386-unknown-unknown %s -fsyntax-only
Chris Lattner5a6ddbf2008-06-21 19:39:06 +00002
3@interface Test {
4 double a;
5}
6@end
7@implementation Test
8@end
9@interface TestObject : Test {
10@public
11 float bar;
12 int foo;
13}
14@end
15@implementation TestObject
16@end
17struct wibble {
18 @defs(TestObject)
19};
20
21
22int main(void)
23{
24 TestObject * a = (id)malloc(100);
25 a->foo = 12;
26 printf("12: %d\n", ((struct wibble*)a)->foo);
27 printf("%d: %d\n", ((char*)&(((struct wibble*)a)->foo)) - (char*)a, ((char*)&(a->foo)) - (char*)a);
28 return 0;
29}