mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
testsuite: Enable cross testing for gcov tests
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 commit is contained in:
@@ -2,7 +2,7 @@
|
||||
constructs are reported correctly by gcov. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
extern "C" void abort (void);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Ensure PIC sequence used for comdat functions */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage -fpic" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-require-effective-target fpic } */
|
||||
|
||||
inline int __attribute__ ((noinline)) Foo ()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
distinct from unexecuted normal regions. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
void Baz (int i)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* PR 51113 */
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage -fpic -fno-implicit-constexpr" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-additional-sources "gcovpart-12b.C" } */
|
||||
|
||||
struct Foo {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
void Baz (int i)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage -Ofast" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-skip-if "requires hosted libstdc++ for iostream" { ! hostedlib } } */
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// PR gcov-profile/64634
|
||||
// { dg-options "-fprofile-arcs -ftest-coverage" }
|
||||
// { dg-do run { target native } }
|
||||
// { dg-do run }
|
||||
|
||||
void catchEx () // count(1)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// PR gcov-profile/64634
|
||||
// { dg-options "-fprofile-arcs -ftest-coverage" }
|
||||
// { dg-do run { target native } }
|
||||
// { dg-do run }
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "--coverage -std=c++11" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
template <class T> class Foo
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "--coverage -fcondition-coverage -std=c++11" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } } */
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* Filtering on the function base name generally works well, because it becomes
|
||||
an unadultered part of the symbol. */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Verify line coverage counts for simple member functions. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage -fno-implicit-constexpr" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
class C {
|
||||
public:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* Filtering also works by targeting the mangled symbol directly, but the
|
||||
subtlety is not really caught by the test framework. Matching on fn1I[df]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* Filters can be applied to demangled names. This support matching on
|
||||
types and class hierarchies as well as function names. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fpath-coverage --coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
#include "gcov-23-1.h"
|
||||
#include "gcov-23-2.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
within a header file. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
#include "gcov-3.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage -fno-exceptions" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
class foo {
|
||||
public:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage -fno-inline" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
class A {
|
||||
int count;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
declaration. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
struct foo
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
class C {
|
||||
public:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-generate -ftest-coverage " } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int value;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-generate -ftest-coverage " } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int value;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage -pthread -fprofile-update=atomic" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-require-effective-target profile_update_atomic } */
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
unsigned
|
||||
loop (unsigned n, int value) /* count(14.0k) */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-require-effective-target init_priority } */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* See PR91087 for information on Darwin xfails. Also PR81337 for Solaris
|
||||
ones.*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// PR gcov-profile/84548
|
||||
// { dg-options "-fprofile-arcs -ftest-coverage" }
|
||||
// { dg-do run { target native } }
|
||||
// { dg-do run }
|
||||
// TODO: add support for groups to gcov.exp script
|
||||
|
||||
struct A { static int foo () { return 1; }; static int bar () {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage -std=c++11" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// PR gcov-profile/88045
|
||||
// { dg-options "-fprofile-arcs -ftest-coverage -std=c++11" }
|
||||
// { dg-do run { target native } }
|
||||
// { dg-do run }
|
||||
/* { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } } */
|
||||
|
||||
#include <numeric>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// PR gcov-profile/88263
|
||||
// { dg-options "-fprofile-arcs -ftest-coverage -std=c++11" }
|
||||
// { dg-do run { target native } }
|
||||
// { dg-do run }
|
||||
/* { dg-skip-if "requires hosted libstdc++ for sstream" { ! hostedlib } } */
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// PR gcov-profile/88263
|
||||
// { dg-options "-fprofile-arcs -ftest-coverage -std=c++11" }
|
||||
// { dg-do run { target native } }
|
||||
// { dg-do run }
|
||||
/* { dg-skip-if "requires hosted libstdc++ for sstream" { ! hostedlib } } */
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// PR gcov-profile/97069
|
||||
// { dg-options "--coverage" }
|
||||
// { dg-do run { target native } }
|
||||
// { dg-do run }
|
||||
|
||||
# 0 "pr97069.C"
|
||||
# 0 "<built-in>"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* PR gcov-profile/98273 */
|
||||
|
||||
/* { dg-options "--coverage -std=c++11" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int
|
||||
main ()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// { dg-options "-fprofile-arcs -ftest-coverage" }
|
||||
// { dg-do run { target native } }
|
||||
// { dg-do run }
|
||||
|
||||
int b, c, d, e;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Test Gcov basics. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
void noop ()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Test gcov block mode. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int main ()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Test gcov block mode. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int main ()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Test gcov block mode. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int one = 1; /* subvert constant folder. */
|
||||
int zero = 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Test gcov weak ellision. */
|
||||
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-require-weak "" } */
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Test gcov weak ellision. */
|
||||
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-require-weak "" } */
|
||||
/* { dg-additional-sources "gcovpart-13b.c" } */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Test gcov extern inline. */
|
||||
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-options "-O2 -fprofile-arcs -ftest-coverage -fgnu89-inline" } */
|
||||
/* The following line arranges that Darwin has behavior like elf weak import. */
|
||||
/* { dg-additional-options "-Wl,-U,_Foo" { target *-*-darwin* } } */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Test gcov multiple paths to file. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
#if !RECURSIVE
|
||||
#define RECURSIVE 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
void
|
||||
bar (void)
|
||||
|
||||
@@ -22,7 +22,7 @@ by both branches of the condition in <bb 3>.
|
||||
*/
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
unsigned int
|
||||
UuT (void)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
just once. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int a = 0;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fcondition-coverage -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* Some side effect to stop branches from being pruned. */
|
||||
int x = 0;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Test Gcov basics. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage -fprofile-abs-path" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
void noop ()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Test Gcov basics. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage -g" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
void noop ()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fcondition-coverage -ftest-coverage -fprofile-update=atomic" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-require-effective-target profile_update_atomic } */
|
||||
|
||||
/* Some side effect to stop branches from being pruned */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fcondition-coverage -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
#include <setjmp.h>
|
||||
jmp_buf buf;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* Filters are considered in order with latest-wins, so if a function is
|
||||
included and later excluded it should not show up. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* Filters are considered in order with latest-wins, so if a function is
|
||||
excluded and later included it should show up. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* If only --exclude is used, other functions should be used by default. */
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int
|
||||
once (int x)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "--coverage -fpath-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
void
|
||||
pathcov001a ()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-require-effective-target label_values } */
|
||||
|
||||
/* Test Gcov with computed gotos.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "--coverage -fpath-coverage -fprofile-update=atomic" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
void
|
||||
pathcov001a ()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "--coverage -fpath-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* BEGIN paths
|
||||
summary: 1/2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "--coverage -fpath-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* BEGIN paths
|
||||
summary: 1/2
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
correctly by gcov. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
extern void abort (void);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
correctly by gcov. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
extern void abort (void);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
that are large enough to hold the count. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
#define LIMIT1 7000
|
||||
#define LIMIT2 7000
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
for call return percentages was added. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
extern void exit (int);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* and call return percentages for functions that call longjmp. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int proxy (int i)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Test gcov block mode. */
|
||||
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int main ()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
union U
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int x, y;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int a=0;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int doit(int sel, int n, void *p)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
void Test(long long Val, int Amt)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int main (void)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
/* { dg-require-effective-target indirect_jumps } */
|
||||
|
||||
void *buf[5];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// PR gcov-profile/86536
|
||||
// { dg-options "-fprofile-arcs -ftest-coverage" }
|
||||
// { dg-do run { target native } }
|
||||
// { dg-do run }
|
||||
// { dg-require-fork "" }
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-options "-fcondition-coverage -ftest-coverage" } */
|
||||
/* { dg-do run { target native } } */
|
||||
/* { dg-do run } */
|
||||
|
||||
/* Some side effect to stop branches from being pruned. */
|
||||
int x = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- { dg-options "-fprofile-arcs -ftest-coverage" }
|
||||
-- { dg-do run { target native } } */
|
||||
-- { dg-do run } */
|
||||
|
||||
procedure Check is
|
||||
|
||||
|
||||
@@ -31,6 +31,23 @@ proc clean-gcov-file { testcase suffix } {
|
||||
set basename [file tail $testcase]
|
||||
set base [file rootname $basename]
|
||||
remote_file host delete $base.$suffix
|
||||
# The absolute path to the output when building on the host is
|
||||
# used by the compiled program on the target to determine where
|
||||
# the .gcda file goes there.
|
||||
remote_file target delete [remote_file host absolute $base.$suffix]
|
||||
}
|
||||
|
||||
# Transfer the .gcda file for a test from the target to the host.
|
||||
|
||||
proc transfer-gcda { testcase } {
|
||||
set basename [file tail $testcase]
|
||||
set base [file rootname $basename]
|
||||
# The absolute path to the output when building on the host is
|
||||
# used by the compiled program on the target to determine where
|
||||
# the .gcda file goes there.
|
||||
set gcda [remote_file host absolute "$base.gcda"]
|
||||
set gcda [remote_upload target $gcda]
|
||||
remote_download host $gcda
|
||||
}
|
||||
|
||||
#
|
||||
@@ -763,6 +780,14 @@ proc run-gcov { args } {
|
||||
if { $gcov_remove_gcda } {
|
||||
verbose "Removing $testcase.gcda"
|
||||
clean-gcov-file $testcase "gcda"
|
||||
} else {
|
||||
transfer-gcda $testcase
|
||||
global additional_sources_used
|
||||
if [info exists additional_sources_used] {
|
||||
foreach srcfile $additional_sources_used {
|
||||
transfer-gcda $srcfile
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
verbose "Running $GCOV $testcase" 2
|
||||
|
||||
Reference in New Issue
Block a user