Merge from mainline (160224:163495).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / struct / w_prof_global_var.c
blobbaff45d917db1f7ccd7f1105abdcf3ae6da38788
1 #include <stdlib.h>
2 typedef struct
4 int a;
5 float b;
6 }str_t;
8 #ifdef STACK_SIZE
9 #if STACK_SIZE > 8000
10 #define N 1000
11 #else
12 #define N (STACK_SIZE/8)
13 #endif
14 #else
15 #define N 1000
16 #endif
18 str_t *p;
20 int
21 main ()
23 int i, sum;
25 p = malloc (N * sizeof (str_t));
26 if (p == NULL)
27 return 0;
28 for (i = 0; i < N; i++)
29 p[i].b = i;
31 for (i = 0; i < N; i++)
32 p[i].a = p[i].b + 1;
34 for (i = 0; i < N; i++)
35 if (p[i].a != p[i].b + 1)
36 abort ();
38 return 0;
41 /*--------------------------------------------------------------------------*/
42 /* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
43 /* { dg-final-use { cleanup-ipa-dump "*" } } */