aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gcov/gcov-20.C
blob: fb33f7ecbddab50a99532d8ed039c8ed7cae5f7f (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
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */

/* Filtering also works by targeting the mangled symbol directly, but the
   subtlety is not really caught by the test framework.  Matching on fn1I[df]
   prints the "overlapping blocks" of both the float and double instantiation,
   but *not* the int instantiation.  The extra {} around the --include argument
   is quoting for tcl/dejagnu.  */

template <typename T>
T
fn1 (T x)
{
  /* fst */
  return x;
}

template <typename T>
T
fn2 (T x)
{
  /* snd */
  return 2 * x;
}

int
main ()
{
  fn1 (2);
  fn1 (2.0);
  fn1 (2.0f);

  fn2 (2);
  fn2 (2.0);
  fn2 (2.0f);
}

/* { dg-final { run-gcov { filters { fst } { snd } } { {--include=fn1I[fd]} gcov-20.C } } } */