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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tree-prof/] [inliner-1.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-options "-O2 -fdump-tree-optimized" } */
2
int a;
3
int b[100];
4
void abort (void);
5
 
6
inline void
7
cold_function ()
8
{
9
  int i;
10
  for (i = 0; i < 99; i++)
11
    if (b[i] / (b[i+1] + 1))
12
      abort ();
13
}
14
 
15
inline void
16
hot_function ()
17
{
18
  int i;
19
  for (i = 0; i < 99; i++)
20
    if (b[i] / (b[i+1] + 1))
21
      abort ();
22
}
23
 
24
main ()
25
{
26
  int i;
27
  for (i = 0; i < 100; i++)
28
    {
29
      if (a)
30
        cold_function ();
31
      else
32
        hot_function ();
33
    }
34
  return 0;
35
}
36
 
37
/* cold function should be inlined, while hot function should not.
38
   Look for "cold_function () [tail call];" call statement not for the
39
   declaration or other apperances of the string in dump.  */
40
/* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */
41
/* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */
42
/* { dg-final-use { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

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