aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gcov/gcov-11.C
blob: fa0890206f3acbc37f6b0ea333a32d5d40d6b428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* Check that unexecuted exception processing regions are shown
   distinct from  unexecuted normal regions.  */

/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */

void Baz (int i)
{
  if (i)
    throw 1;
}

void Boz () throw ()
{
}

int main ()
{
  try
    {
      Baz (0);  /* count (1) */
      Baz (0);  /* count (1) */
    }
  catch (...)
    {
      Boz ();  /* count (=====) */
    }

  try
    {
      Baz (1);  /* count (1) */
      Baz (0);  /* count (#####) */
    }
  catch (...)
    {
      Boz ();  /* count (1) */
    }

  return 0;  /* count (1) */
}

/* { dg-final { run-gcov gcov-11.C } } */