aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof_1.c
blob: 0cdb607cd3d69f13e0712c86ff44e0190dd42aad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */

int a1 (void)
{
    return 10;
}

int a2 (void)
{
    return 0;
}

typedef int (*tp) (void);

tp aa [] = {a2, a1, a1, a1, a1};

__attribute__((noinline)) void setp (int (**pp) (void), int i)
{
  if (!i)
    *pp = aa [i];
  else
    *pp = aa [(i & 2) + 1];
}