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);
/* 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 ()
distinct from unexecuted normal regions. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
void Baz (int i)
{
/* 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 {
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
void Baz (int i)
{
/* { 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>
// PR gcov-profile/64634
// { dg-options "-fprofile-arcs -ftest-coverage" }
-// { dg-do run { target native } }
+// { dg-do run }
void catchEx () // count(1)
{
// PR gcov-profile/64634
// { dg-options "-fprofile-arcs -ftest-coverage" }
-// { dg-do run { target native } }
+// { dg-do run }
int main()
{
/* { dg-options "--coverage -std=c++11" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
template <class T> class Foo
{
/* { 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>
/* { 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. */
/* 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:
/* { 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]
/* { 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. */
/* { dg-options "-fpath-coverage --coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
#include "gcov-23-1.h"
#include "gcov-23-2.h"
within a header file. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
#include "gcov-3.h"
#include <stdio.h>
/* { dg-options "-fprofile-arcs -ftest-coverage -fno-exceptions" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
class foo {
public:
#include <stdlib.h>
/* { dg-options "-fprofile-arcs -ftest-coverage -fno-inline" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
class A {
int count;
declaration. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
struct foo
{
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
class C {
public:
/* { dg-options "-fprofile-generate -ftest-coverage " } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int value;
/* { dg-options "-fprofile-generate -ftest-coverage " } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int value;
/* { 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>
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
unsigned
loop (unsigned n, int value) /* count(14.0k) */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
/* { dg-require-effective-target init_priority } */
#include <stdlib.h>
/* { 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.*/
// 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 () {
/* { dg-options "-fprofile-arcs -ftest-coverage -std=c++11" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int main()
{
// 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>
// 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>
// 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>
// PR gcov-profile/97069
// { dg-options "--coverage" }
-// { dg-do run { target native } }
+// { dg-do run }
# 0 "pr97069.C"
# 0 "<built-in>"
/* PR gcov-profile/98273 */
/* { dg-options "--coverage -std=c++11" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int
main ()
// { dg-options "-fprofile-arcs -ftest-coverage" }
-// { dg-do run { target native } }
+// { dg-do run }
int b, c, d, e;
/* Test Gcov basics. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
void noop ()
{
/* Test gcov block mode. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int main ()
{
/* Test gcov block mode. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int main ()
{
/* 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;
/* Test gcov weak ellision. */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
/* { dg-require-weak "" } */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* 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" } */
/* 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* } } */
/* 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
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
void
bar (void)
*/
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
unsigned int
UuT (void)
just once. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int a = 0;
/* { 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;
/* Test Gcov basics. */
/* { dg-options "-fprofile-arcs -ftest-coverage -fprofile-abs-path" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
void noop ()
{
/* Test Gcov basics. */
/* { dg-options "-fprofile-arcs -ftest-coverage -g" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
void noop ()
{
/* { 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 */
/* { dg-options "-fcondition-coverage -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
#include <setjmp.h>
jmp_buf buf;
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int main()
{
/* { 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. */
/* { 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. */
/* { 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. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int
once (int x)
/* { dg-options "--coverage -fpath-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
void
pathcov001a ()
-/* { dg-do run { target native } } */
+/* { dg-do run } */
/* { dg-require-effective-target label_values } */
/* Test Gcov with computed gotos.
/* { dg-options "--coverage -fpath-coverage -fprofile-update=atomic" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
void
pathcov001a ()
/* { dg-options "--coverage -fpath-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
/* BEGIN paths
summary: 1/2
/* { dg-options "--coverage -fpath-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
/* BEGIN paths
summary: 1/2
correctly by gcov. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
extern void abort (void);
correctly by gcov. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
extern void abort (void);
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
for call return percentages was added. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
extern void exit (int);
* 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>
*/
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int proxy (int i)
{
/* Test gcov block mode. */
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int main ()
{
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
union U
{
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int x, y;
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int a=0;
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int doit(int sel, int n, void *p)
{
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
void Test(long long Val, int Amt)
{
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int main (void)
{
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
/* { dg-require-effective-target indirect_jumps } */
void *buf[5];
// PR gcov-profile/86536
// { dg-options "-fprofile-arcs -ftest-coverage" }
-// { dg-do run { target native } }
+// { dg-do run }
// { dg-require-fork "" }
#include <stdlib.h>
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int main(int argc, char **argv)
{
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-/* { dg-do run { target native } } */
+/* { dg-do run } */
int main(int argc, char **argv)
{
/* { 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;
-- { dg-options "-fprofile-arcs -ftest-coverage" }
--- { dg-do run { target native } } */
+-- { dg-do run } */
procedure Check is
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
}
#
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