Pass name cleanups
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / indir-call-prof.c
blobdf7481f4daff484c45f4259d4034d336cf80f5d0
1 /* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
3 static int a1 (void)
5 return 10;
8 static int a2 (void)
10 return 0;
13 typedef int (*tp) (void);
15 static tp aa [] = {a2, a1, a1, a1, a1};
17 void setp (int (**pp) (void), int i)
19 if (!i)
20 *pp = aa [i];
21 else
22 *pp = aa [(i & 2) + 1];
25 int
26 main (void)
28 int (*p) (void);
29 int i;
31 for (i = 0; i < 10; i ++)
33 setp (&p, i);
34 p ();
37 return 0;
40 /* { dg-final-use { scan-ipa-dump "Indirect call -> direct call.* a1 transformation on insn" "profile"} } */
41 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
42 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
43 /* { dg-final-use { cleanup-ipa-dump "profile" } } */