Create x.gcov file for binary w/o x.gcda file (PR
* g++.dg/gcov/gcov-16.C: New test. * lib/gcov.exp: Support new argument for run-gcov function. Adam Fineman <afineman@afineman.com> * gcov.c (process_file): Create .gcov file when .gcda file is missing. From-SVN: r239413
This commit is contained in:
parent
5cacda56cb
commit
20d1af89b4
@ -1,3 +1,10 @@
|
|||||||
|
2016-08-12 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
|
Adam Fineman <afineman@afineman.com>
|
||||||
|
|
||||||
|
* gcov.c (process_file): Create .gcov file when .gcda
|
||||||
|
file is missing.
|
||||||
|
|
||||||
2016-08-12 Marek Polacek <polacek@redhat.com>
|
2016-08-12 Marek Polacek <polacek@redhat.com>
|
||||||
|
|
||||||
PR c/7652
|
PR c/7652
|
||||||
|
@ -902,7 +902,7 @@ process_file (const char *file_name)
|
|||||||
|
|
||||||
fns = fn->next;
|
fns = fn->next;
|
||||||
fn->next = NULL;
|
fn->next = NULL;
|
||||||
if (fn->counts)
|
if (fn->counts || no_data_file)
|
||||||
{
|
{
|
||||||
unsigned src = fn->src;
|
unsigned src = fn->src;
|
||||||
unsigned line = fn->line;
|
unsigned line = fn->line;
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2016-08-12 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
|
* g++.dg/gcov/gcov-16.C: New test.
|
||||||
|
* lib/gcov.exp: Support new argument for run-gcov function.
|
||||||
|
|
||||||
2016-08-12 Martin Liska <mliska@suse.cz>
|
2016-08-12 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
PR gcov-profile/35590
|
PR gcov-profile/35590
|
||||||
|
10
gcc/testsuite/g++.dg/gcov/gcov-16.C
Normal file
10
gcc/testsuite/g++.dg/gcov/gcov-16.C
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// PR gcov-profile/64634
|
||||||
|
// { dg-options "-fprofile-arcs -ftest-coverage" }
|
||||||
|
// { dg-do run { target native } }
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0; /* count(#####) */
|
||||||
|
}
|
||||||
|
|
||||||
|
// { dg-final { run-gcov remove-gcda gcov-16.C } }
|
@ -19,16 +19,28 @@
|
|||||||
|
|
||||||
global GCOV
|
global GCOV
|
||||||
|
|
||||||
|
#
|
||||||
|
# clean-gcov-file -- delete a working file the compiler creates for gcov
|
||||||
|
#
|
||||||
|
# TESTCASE is the name of the test.
|
||||||
|
# SUFFIX is file suffix
|
||||||
|
|
||||||
|
proc clean-gcov-file { testcase suffix } {
|
||||||
|
set basename [file tail $testcase]
|
||||||
|
set base [file rootname $basename]
|
||||||
|
remote_file host delete $base.$suffix
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# clean-gcov -- delete the working files the compiler creates for gcov
|
# clean-gcov -- delete the working files the compiler creates for gcov
|
||||||
#
|
#
|
||||||
# TESTCASE is the name of the test.
|
# TESTCASE is the name of the test.
|
||||||
#
|
#
|
||||||
proc clean-gcov { testcase } {
|
proc clean-gcov { testcase } {
|
||||||
set basename [file tail $testcase]
|
clean-gcov-file $testcase "gcno"
|
||||||
set base [file rootname $basename]
|
clean-gcov-file $testcase "gcda"
|
||||||
remote_file host delete $base.gcno $base.gcda \
|
clean-gcov-file $testcase "gcov"
|
||||||
$basename.gcov $base.h.gcov
|
clean-gcov-file $testcase "h.gcov"
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -305,6 +317,7 @@ proc run-gcov { args } {
|
|||||||
set gcov_verify_branches 0
|
set gcov_verify_branches 0
|
||||||
set gcov_verify_lines 1
|
set gcov_verify_lines 1
|
||||||
set gcov_verify_intermediate 0
|
set gcov_verify_intermediate 0
|
||||||
|
set gcov_remove_gcda 0
|
||||||
set xfailed 0
|
set xfailed 0
|
||||||
|
|
||||||
foreach a $args {
|
foreach a $args {
|
||||||
@ -317,6 +330,8 @@ proc run-gcov { args } {
|
|||||||
set gcov_verify_calls 0
|
set gcov_verify_calls 0
|
||||||
set gcov_verify_branches 0
|
set gcov_verify_branches 0
|
||||||
set gcov_verify_lines 0
|
set gcov_verify_lines 0
|
||||||
|
} elseif { $a == "remove-gcda" } {
|
||||||
|
set gcov_remove_gcda 1
|
||||||
} elseif { $gcov_args == "" } {
|
} elseif { $gcov_args == "" } {
|
||||||
set gcov_args $a
|
set gcov_args $a
|
||||||
} else {
|
} else {
|
||||||
@ -332,6 +347,11 @@ proc run-gcov { args } {
|
|||||||
# Extract the test file name from the arguments.
|
# Extract the test file name from the arguments.
|
||||||
set testcase [lindex $gcov_args end]
|
set testcase [lindex $gcov_args end]
|
||||||
|
|
||||||
|
if { $gcov_remove_gcda } {
|
||||||
|
verbose "Removing $testcase.gcda"
|
||||||
|
clean-gcov-file $testcase "gcda"
|
||||||
|
}
|
||||||
|
|
||||||
verbose "Running $GCOV $testcase" 2
|
verbose "Running $GCOV $testcase" 2
|
||||||
set testcase [remote_download host $testcase]
|
set testcase [remote_download host $testcase]
|
||||||
set result [remote_exec host $GCOV $gcov_args]
|
set result [remote_exec host $GCOV $gcov_args]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user