1/* { dg-require-effective-target int32plus } */ 2struct big 3{ 4 int data[1000000]; 5}; 6 7struct small 8{ 9 int data[10]; 10}; 11 12union both 13{ 14 struct big big; 15 struct small small; 16}; 17 18extern void *calloc (__SIZE_TYPE__, __SIZE_TYPE__); 19extern void free (void *); 20 21static int __attribute__((noinline)) 22foo (int fail, union both *agg) 23{ 24 int r; 25 if (fail) 26 r = agg->big.data[999999]; 27 else 28 r = agg->small.data[0]; 29 return r; 30} 31 32int main (int argc, char *argv[]) 33{ 34 union both *agg = calloc (1, sizeof (struct small)); 35 int r; 36 37 r = foo ((argc > 2000), agg); 38 39 free (agg); 40 return r; 41} 42