mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
39a93faab07ff64a9e828f487f231b013b6cdbdc
Tests of gcov are generally restricted to { target native }. The
issue for these tests is the need to transfer .gcda files from the
target to the host before running gcov. Implement that support and
remove the { target native } restrictions for these tests.
Note that by default code built to generate coverage data expects to
be able to write .gcda files to the same directory name in which the
compiler generated its output, so if that path cannot be created by
the tests on the target then they may still not work in a cross setup.
Other options involving -fprofile-dir are possible but involve their
own complications such as mangling of the .gcda file name (the
mangling logic would then need replicating in gcov.exp). Copying
files from the target using such absolute directory paths is what
already happens with gcc.dg/tree-prof tests using profopt.exp (and
those already work in a cross configuration except for a few using
dg-additional-sources), so this change is effectively making the gcov
tests work more like the tree-prof ones.
Note also that [remote_file host absolute ...] may require appropriate
support in your host board file for the case of a remote host (this
isn't an operation DejaGnu knows about doing remotely by default).
The logic for determining .gcda paths does mean it's the absolute path
on host, not on build, that is relevant.
Tested for x86_64-pc-linux-gnu to make sure native testing isn't
broken, and with cross to aarch64-linux.
* g++.dg/gcov/gcov-1.C, g++.dg/gcov/gcov-10.C,
g++.dg/gcov/gcov-11.C, g++.dg/gcov/gcov-12.C,
g++.dg/gcov/gcov-13.C, g++.dg/gcov/gcov-14.C,
g++.dg/gcov/gcov-15.C, g++.dg/gcov/gcov-16.C,
g++.dg/gcov/gcov-17.C, g++.dg/gcov/gcov-18.C,
g++.dg/gcov/gcov-19.C, g++.dg/gcov/gcov-2.C,
g++.dg/gcov/gcov-20.C, g++.dg/gcov/gcov-21.C,
g++.dg/gcov/gcov-23.C, g++.dg/gcov/gcov-3.C, g++.dg/gcov/gcov-4.C,
g++.dg/gcov/gcov-5.C, g++.dg/gcov/gcov-7.C, g++.dg/gcov/gcov-8.C,
g++.dg/gcov/gcov-dump-1.C, g++.dg/gcov/gcov-dump-2.C,
g++.dg/gcov/gcov-threads-1.C, g++.dg/gcov/loop.C,
g++.dg/gcov/pr16855-priority.C, g++.dg/gcov/pr16855.C,
g++.dg/gcov/pr84548.C, g++.dg/gcov/pr86109.C,
g++.dg/gcov/pr88045.C, g++.dg/gcov/pr88263-2.C,
g++.dg/gcov/pr88263.C, g++.dg/gcov/pr97069.C,
g++.dg/gcov/pr98273.C, g++.dg/gcov/ternary.C,
gcc.misc-tests/gcov-1.c, gcc.misc-tests/gcov-10.c,
gcc.misc-tests/gcov-10b.c, gcc.misc-tests/gcov-11.c,
gcc.misc-tests/gcov-12.c, gcc.misc-tests/gcov-13.c,
gcc.misc-tests/gcov-14.c, gcc.misc-tests/gcov-15.c,
gcc.misc-tests/gcov-16.c, gcc.misc-tests/gcov-17.c,
gcc.misc-tests/gcov-18.c, gcc.misc-tests/gcov-19.c,
gcc.misc-tests/gcov-1a.c, gcc.misc-tests/gcov-2.c,
gcc.misc-tests/gcov-20.c, gcc.misc-tests/gcov-22.c,
gcc.misc-tests/gcov-24.c, gcc.misc-tests/gcov-25.c,
gcc.misc-tests/gcov-26.c, gcc.misc-tests/gcov-27.c,
gcc.misc-tests/gcov-28.c, gcc.misc-tests/gcov-29.c,
gcc.misc-tests/gcov-3.c, gcc.misc-tests/gcov-30.c,
gcc.misc-tests/gcov-33.c, gcc.misc-tests/gcov-34.c,
gcc.misc-tests/gcov-4.c, gcc.misc-tests/gcov-4b.c,
gcc.misc-tests/gcov-5b.c, gcc.misc-tests/gcov-6.c,
gcc.misc-tests/gcov-7.c, gcc.misc-tests/gcov-8.c,
gcc.misc-tests/gcov-9.c, gcc.misc-tests/gcov-pr83813.c,
gcc.misc-tests/gcov-pr84758.c, gcc.misc-tests/gcov-pr85217.c,
gcc.misc-tests/gcov-pr85332.c, gcc.misc-tests/gcov-pr85338.c,
gcc.misc-tests/gcov-pr85350.c, gcc.misc-tests/gcov-pr85372.c,
gcc.misc-tests/gcov-pr86536.c, gcc.misc-tests/gcov-pr90574-1.c,
gcc.misc-tests/gcov-pr90574-2.c, gdc.dg/gcov1.d,
gnat.dg/gcov/check.adb: Do not restrict to { target native }.
* lib/gcov.exp (transfer-gcda): New.
(clean-gcov-file): Delete .gcda file on target.
(run-gcov): Transfer .gcda files from target.
…
…
…
…
…
…
…
…
…
…
…
…
…
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.
Description
Languages
C++
30.8%
C
30.2%
Ada
14.4%
D
6.1%
Go
5.7%
Other
12.3%