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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.misc-tests/] [gcov-6.c] - Diff between revs 149 and 154

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
/* Check that call return percentages are reported correctly by gcov,
/* Check that call return percentages are reported correctly by gcov,
   along with line counts and branch percentages.  This test case is
   along with line counts and branch percentages.  This test case is
   meant to be simple, as it was added at the same time that checking
   meant to be simple, as it was added at the same time that checking
   for call return percentages was added.  */
   for call return percentages was added.  */
 
 
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */
/* { dg-do run { target native } } */
 
 
extern void exit (int);
extern void exit (int);
 
 
int val;
int val;
 
 
void
void
foo (int i)
foo (int i)
{
{
                                        /* branch(80) */
                                        /* branch(80) */
  if (i < 0)                             /* count(5) */
  if (i < 0)                             /* count(5) */
                                        /* branch(end) */
                                        /* branch(end) */
                                        /* returns(0) */
                                        /* returns(0) */
    exit (0);                            /* count(1) */
    exit (0);                            /* count(1) */
                                        /* returns(end) */
                                        /* returns(end) */
  val += i;                             /* count(4) */
  val += i;                             /* count(4) */
}
}
 
 
int
int
main()
main()
{
{
  int i;
  int i;
 
 
                                        /* returns(100) */
                                        /* returns(100) */
  foo (100);                            /* count(1) */
  foo (100);                            /* count(1) */
                                        /* returns(end) */
                                        /* returns(end) */
  for (i = 2; i > -10; i--)
  for (i = 2; i > -10; i--)
                                        /* returns(75) */
                                        /* returns(75) */
    foo (i);                            /* count(4) */
    foo (i);                            /* count(4) */
                                        /* returns(end) */
                                        /* returns(end) */
}
}
 
 
/* { dg-final { run-gcov branches calls { -b gcov-6.c } } } */
/* { dg-final { run-gcov branches calls { -b gcov-6.c } } } */
 
 

powered by: WebSVN 2.1.0

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