Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.c-torture / execute / 991014-1.c
blob7b1b5fa40d0ec094c3bc0c4db3e00cf9ca838eda
2 typedef typeof(sizeof(char)) Size_t;
4 #define bufsize ((1L << (8 * sizeof(Size_t) - 2))-256)
6 struct huge_struct
8 short buf[bufsize];
9 int a;
10 int b;
11 int c;
12 int d;
15 union huge_union
17 int a;
18 char buf[bufsize];
21 unsigned long union_size()
23 return sizeof(union huge_union);
26 unsigned long struct_size()
28 return sizeof(struct huge_struct);
31 unsigned long struct_a_offset()
33 return (unsigned long)(&((struct huge_struct *) 0)->a);
36 int main()
38 /* Check the exact sizeof value. bufsize is aligned on 256b. */
39 if (union_size() != sizeof(char) * bufsize)
40 abort();
42 if (struct_size() != sizeof(short) * bufsize + 4*sizeof(int))
43 abort();
45 if (struct_a_offset() < sizeof(short) * bufsize)
46 abort();
48 return 0;