OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-prof/] [indir-call-prof.c] - Blame information for rev 315

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */
2
 
3
static int a1 (void)
4
{
5
    return 10;
6
}
7
 
8
static int a2 (void)
9
{
10
    return 0;
11
}
12
 
13
typedef int (*tp) (void);
14
 
15
static tp aa [] = {a2, a1, a1, a1, a1};
16
 
17
void setp (int (**pp) (void), int i)
18
{
19
  if (!i)
20
    *pp = aa [i];
21
  else
22
    *pp = aa [(i & 2) + 1];
23
}
24
 
25
int
26
main (void)
27
{
28
  int (*p) (void);
29
  int  i;
30
 
31
  for (i = 0; i < 10; i ++)
32
    {
33
        setp (&p, i);
34
        p ();
35
    }
36
 
37
  return 0;
38
}
39
 
40
/* { dg-final-use { scan-tree-dump "Indirect call -> direct call.* a1 transformation on insn" "tree_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-tree-dump "tree_profile" } } */
44
 
45
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.