Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / struct / wo_prof_malloc_size_var.c
blob32842b0a7eb1ebca48dd633f3880a1803f163d0b
1 /* { dg-do compile } */
2 /* { dg-do run } */
4 #include <stdlib.h>
5 typedef struct
7 int a;
8 float b;
9 }str_t;
11 #define N 1000
13 int
14 main ()
16 int i, num;
18 num = rand();
19 str_t * p = malloc (num * sizeof (str_t));
21 if (p == 0)
22 return 0;
24 for (i = 0; i < N; i++)
25 p[i].a = p[i].b + 1;
27 for (i = 0; i < N; i++)
28 if (p[i].a != p[i].b + 1)
29 abort ();
31 return 0;
34 /*--------------------------------------------------------------------------*/
35 /* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
36 /* { dg-final { cleanup-ipa-dump "*" } } */