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/] [inliner-1.c] - Blame information for rev 300

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" } */
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
  if (a)
27
    cold_function ();
28
  else
29
    hot_function ();
30
  return 0;
31
}
32
 
33
/* cold function should be inlined, while hot function should not.
34
   Look for "cold_function () [tail call];" call statement not for the
35
   declaration or other apperances of the string in dump.  */
36
/* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */
37
/* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */
38
/* { 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.