Merged trunk at revision 161680 into branch.
[official-gcc.git] / gcc / testsuite / gcc.dg / struct / wo_prof_escape_arg_to_local.c
blob781a847f9f735908a271ba9f63fe1e3c9fda77ed
1 /* { dg-options "-O3 -fno-inline -fno-ipa-sra -fdump-ipa-all -fipa-struct-reorg -fwhole-program -combine" } */
2 /* { dg-do compile } */
3 /* { dg-do run } */
5 #include <stdlib.h>
6 struct str
8 int a;
9 float b;
12 #ifdef STACK_SIZE
13 #if STACK_SIZE > 8000
14 #define N 1000
15 #else
16 #define N (STACK_SIZE/8)
17 #endif
18 #else
19 #define N 1000
20 #endif
22 int
23 foo (struct str * p_str)
25 static int sum = 0;
27 sum = sum + p_str->a;
28 return sum;
31 int
32 main ()
34 int i, sum;
35 struct str * p = malloc (N * sizeof (struct str));
36 if (p == NULL)
37 return 0;
38 for (i = 0; i < N; i++)
39 sum = foo (p+i);
41 return 0;
44 /*--------------------------------------------------------------------------*/
45 /* { dg-final { scan-ipa-dump "is passed to local function...Excluded." "ipa_struct_reorg" { xfail *-*-* } } } */
46 /* { dg-final { cleanup-ipa-dump "*" } } */