wo_prof_escape_substr_value.c: Limit allocation based on STACK_SIZE.
[gcc.git] / gcc / testsuite / gcc.dg / struct / wo_prof_single_str_pointer.c
1 /* { dg-do compile } */
2 /* { dg-do run } */
3
4 #include <stdlib.h>
5 typedef struct
6 {
7 int a;
8 int *b;
9 }str_t;
10
11 #define N 3
12
13 str_t *p;
14
15 int
16 main ()
17 {
18 str_t str;
19 int i;
20 int res = 1 << (1 << N);
21 p = &str;
22 str.a = 2;
23
24 p->b = &(p->a);
25
26 for (i=0; i < N; i++)
27 p->a = *(p->b)*(*(p->b));
28
29 if (p->a != res)
30 abort ();
31
32 return p->a;
33 }
34
35 /*--------------------------------------------------------------------------*/
36 /* The access &(p->a) is handled incorrectly in ipa-struct-reorg.c. */
37 /* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
38 /* { dg-final { cleanup-ipa-dump "*" } } */