2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / consistency.vlad / layout / s-pointer-a-double.c
blob3de02172b5f82e4e6dab9a9d238994c5539d6eca
1 #include <stdio.h>
3 static struct sss{
4 char * f;
5 double a[10];
6 } sss;
8 #define _offsetof(st,f) ((char *)&((st *) 16)->f - (char *) 16)
10 int main (void) {
11 printf ("++++Array of double in struct starting with pointer:\n");
12 printf ("size=%d,align=%d\n",
13 sizeof (sss), __alignof__ (sss));
14 printf ("offset-pointer=%d,offset-arrayof-double=%d,\nalign-pointer=%d,align-arrayof-double=%d\n",
15 _offsetof (struct sss, f), _offsetof (struct sss, a),
16 __alignof__ (sss.f), __alignof__ (sss.a));
17 printf ("offset-double-a[5]=%d,align-double-a[5]=%d\n",
18 _offsetof (struct sss, a[5]),
19 __alignof__ (sss.a[5]));
20 return 0;