aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gcov
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-10-31 12:57:43 +0100
committerMartin Liska <marxin@gcc.gnu.org>2017-10-31 11:57:43 +0000
commitcdb07de7c67cf0d04607ee8e85a659d8bf7594f6 (patch)
tree2834b8b25186936729ec0a78931fe0cb902c62a0 /gcc/testsuite/g++.dg/gcov
parent28f4a4a85f3b95f7ccf7585eaa5cbd50cbe1677d (diff)
downloadgcc-cdb07de7c67cf0d04607ee8e85a659d8bf7594f6.zip
gcc-cdb07de7c67cf0d04607ee8e85a659d8bf7594f6.tar.gz
gcc-cdb07de7c67cf0d04607ee8e85a659d8bf7594f6.tar.bz2
GCOV: add support for lines with an unexecuted lines.
2017-10-31 Martin Liska <mliska@suse.cz> * doc/gcov.texi: Document that. * gcov.c (add_line_counts): Mark lines with a non-executed statement. (output_line_beginning): Handle such lines. (output_lines): Pass new argument. (output_intermediate_file): Print it in intermediate format. 2017-10-31 Martin Liska <mliska@suse.cz> * g++.dg/gcov/ternary.C: New test. * g++.dg/gcov/gcov-threads-1.C (main): Update expected line count. * lib/gcov.exp: Support new format for intermediate file format. From-SVN: r254259
Diffstat (limited to 'gcc/testsuite/g++.dg/gcov')
-rw-r--r--gcc/testsuite/g++.dg/gcov/gcov-threads-1.C4
-rw-r--r--gcc/testsuite/g++.dg/gcov/ternary.C12
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/testsuite/g++.dg/gcov/gcov-threads-1.C b/gcc/testsuite/g++.dg/gcov/gcov-threads-1.C
index cc9266a..cc912f9 100644
--- a/gcc/testsuite/g++.dg/gcov/gcov-threads-1.C
+++ b/gcc/testsuite/g++.dg/gcov/gcov-threads-1.C
@@ -31,14 +31,14 @@ int main(int argc, char **argv) {
{
ids[i] = i;
int r = pthread_create (&t[i], NULL, ContentionNoDeadlock_thread, &ids[i]);
- assert (r == 0); /* count(5) */
+ assert (r == 0); /* count(5*) */
}
int ret;
for (int i = 0; i < NR; i++)
{
int r = pthread_join (t[i], (void**)&ret);
- assert (r == 0); /* count(5) */
+ assert (r == 0); /* count(5*) */
}
return 0; /* count(1) */
diff --git a/gcc/testsuite/g++.dg/gcov/ternary.C b/gcc/testsuite/g++.dg/gcov/ternary.C
new file mode 100644
index 0000000..d055928
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gcov/ternary.C
@@ -0,0 +1,12 @@
+// { dg-options "-fprofile-arcs -ftest-coverage" }
+// { dg-do run { target native } }
+
+int b, c, d, e;
+
+int main()
+{
+ int a = b < 1 ? (c < 3 ? d : c) : e; /* count(1*) */
+ return a;
+}
+
+// { dg-final { run-gcov remove-gcda ternary.C } }