xref: /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/consistency.vlad/layout/s-long-s-double.c (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1 #include <stdio.h>
2 
3 static struct sss{
4   long f;
5   struct {double m;} snd;
6 } sss;
7 
8 #define _offsetof(st,f) ((char *)&((st *) 16)->f - (char *) 16)
9 
main(void)10 int main (void) {
11   printf ("+++Struct double inside struct starting with long:\n");
12   printf ("size=%d,align=%d\n", sizeof (sss), __alignof__ (sss));
13   printf ("offset-long=%d,offset-sss-double=%d,\nalign-long=%d,align-sss-double=%d\n",
14           _offsetof (struct sss, f), _offsetof (struct sss, snd),
15           __alignof__ (sss.f), __alignof__ (sss.snd));
16   return 0;
17 }
18