The --coverage flag is a useful alias for -fprofile-arcs
-ftest-coverage where the latter makes gcc output the .gcno file.
While it makes sense to use -fprofile-arcs without a .gcno file (pgo,
maybe more), it never really makes sense to request -fpath-coverage or
-fcondition-coverage without also wanting the .gcno to interpret the
results.
gcc/ChangeLog:
* common.opt: ftest-coverage enabled by fpath-coverage or
fcondition-coverage
gcc/testsuite/ChangeLog:
* g++.dg/gcov/gcov-18.C: Remove --coverage.
* g++.dg/gcov/gcov-22.C: Likewise.
* gcc.misc-tests/gcov-19.c: Remove -ftest-coverage.
* gcc.misc-tests/gcov-29.c: Likewise.
Check for syntax errors, then stop.
ftest-coverage
-Common Var(flag_test_coverage)
+Common Var(flag_test_coverage) EnabledBy(fpath-coverage || fcondition-coverage)
Create data files needed by \"gcov\".
fthread-jumps
-/* { dg-options "--coverage -fcondition-coverage -std=c++11" } */
+/* { dg-options "-fcondition-coverage -std=c++11" } */
/* { dg-do run } */
/* { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } } */
-/* { dg-options "--coverage -fpath-coverage" } */
+/* { dg-options "-fpath-coverage" } */
/* { dg-do compile } */
#include <stdexcept>
-/* { dg-options "-fcondition-coverage -ftest-coverage" } */
+/* { dg-options "-fcondition-coverage" } */
/* { dg-do run } */
/* Some side effect to stop branches from being pruned. */
-/* { dg-options "--coverage -fpath-coverage" } */
+/* { dg-options "-fpath-coverage" } */
/* { dg-do run } */
void