aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1.c
blob: 67a76c9f1eba76b3a59537a8a8d13dae26a62487 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-require-effective-target lto } */
/* { dg-additional-sources "crossmodule-indircall-1a.c" } */
/* { dg-options "-O3 -flto -DDOJOB=1" } */

int a;
extern void (*p[2])(int n);
void abort (void);
main()
{ int i;

  /* This call shall be converted.  */
  for (i = 0;i<1000;i++)
    p[0](1);
  /* This call shall not be converted.  */
  for (i = 0;i<1000;i++)
    p[i%2](2);
  if (a != 1000)
    abort ();

  return 0;
}