Debian Codegraph @

gcc/testsuite/g++.dg/gcov/gcov-20.C

raw
1 /* { dg-options "-fprofile-arcs -ftest-coverage" } */
2 /* { dg-do run { target native } } */
3
4 /* Filtering also works by targeting the mangled symbol directly, but the
5 subtlety is not really caught by the test framework. Matching on fn1I[df]
6 prints the "overlapping blocks" of both the float and double instantiation,
7 but *not* the int instantiation. The extra {} around the --include argument
8 is quoting for tcl/dejagnu. */
9
10 template <typename T>
11 T
12 fn1 (T x)
13 {
14 /* fst */
15 return x;
16 }
17
18 template <typename T>
19 T
20 fn2 (T x)
21 {
22 /* snd */
23 return 2 * x;
24 }
25
26 int
27 main ()
28 {
29 fn1 (2);
30 fn1 (2.0);
31 fn1 (2.0f);
32
33 fn2 (2);
34 fn2 (2.0);
35 fn2 (2.0f);
36 }
37
38 /* { dg-final { run-gcov { filters { fst } { snd } } { {--include=fn1I[fd]} gcov-20.C } } } */