Commit 20d1af89 by Martin Liska Committed by Martin Liska

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
parent 5cacda56
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>
PR c/7652
......
......@@ -902,7 +902,7 @@ process_file (const char *file_name)
fns = fn->next;
fn->next = NULL;
if (fn->counts)
if (fn->counts || no_data_file)
{
unsigned src = fn->src;
unsigned line = fn->line;
......
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>
PR gcov-profile/35590
* gcc.dg/tree-prof/val-prof-7.c: Improve test coverage.
......
// 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 } }
......@@ -20,15 +20,27 @@
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
#
# TESTCASE is the name of the test.
#
proc clean-gcov { testcase } {
set basename [file tail $testcase]
set base [file rootname $basename]
remote_file host delete $base.gcno $base.gcda \
$basename.gcov $base.h.gcov
clean-gcov-file $testcase "gcno"
clean-gcov-file $testcase "gcda"
clean-gcov-file $testcase "gcov"
clean-gcov-file $testcase "h.gcov"
}
#
......@@ -305,6 +317,7 @@ proc run-gcov { args } {
set gcov_verify_branches 0
set gcov_verify_lines 1
set gcov_verify_intermediate 0
set gcov_remove_gcda 0
set xfailed 0
foreach a $args {
......@@ -317,6 +330,8 @@ proc run-gcov { args } {
set gcov_verify_calls 0
set gcov_verify_branches 0
set gcov_verify_lines 0
} elseif { $a == "remove-gcda" } {
set gcov_remove_gcda 1
} elseif { $gcov_args == "" } {
set gcov_args $a
} else {
......@@ -332,6 +347,11 @@ proc run-gcov { args } {
# Extract the test file name from the arguments.
set testcase [lindex $gcov_args end]
if { $gcov_remove_gcda } {
verbose "Removing $testcase.gcda"
clean-gcov-file $testcase "gcda"
}
verbose "Running $GCOV $testcase" 2
set testcase [remote_download host $testcase]
set result [remote_exec host $GCOV $gcov_args]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment