aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.misc-tests/gcov-pr86536.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-07-26 10:50:21 +0200
committerMartin Liska <marxin@gcc.gnu.org>2018-07-26 08:50:21 +0000
commit977667e6b74a56db3747caaed8ba776f6cae8cdf (patch)
treef468ca975fd865c0d7797df158bad531b2c05eed /gcc/testsuite/gcc.misc-tests/gcov-pr86536.c
parent6dd580109f5297ae467d3c32204530a735925ba9 (diff)
downloadgcc-977667e6b74a56db3747caaed8ba776f6cae8cdf.zip
gcc-977667e6b74a56db3747caaed8ba776f6cae8cdf.tar.gz
gcc-977667e6b74a56db3747caaed8ba776f6cae8cdf.tar.bz2
gcov: Fix wrong usage of NAN in statistics (PR gcov-profile/86536).
2018-07-26 Martin Liska <mliska@suse.cz> PR gcov-profile/86536 * gcov.c (format_gcov): Use printf format %.*f directly and do not handle special values. 2018-07-26 Martin Liska <mliska@suse.cz> PR gcov-profile/86536 * gcc.misc-tests/gcov-pr86536.c: New test. From-SVN: r262991
Diffstat (limited to 'gcc/testsuite/gcc.misc-tests/gcov-pr86536.c')
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-pr86536.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr86536.c b/gcc/testsuite/gcc.misc-tests/gcov-pr86536.c
new file mode 100644
index 0000000..4817773
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcov-pr86536.c
@@ -0,0 +1,25 @@
+// PR gcov-profile/86536
+// { dg-options "-fprofile-arcs -ftest-coverage" }
+// { dg-do run { target native } }
+// { dg-require-fork "" }
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+int
+main (void)
+{
+
+ int j = 22; /* count(1) */
+
+ /* returns(200) */
+ fork (); /* count(1) */
+ /* returns(end) */
+
+ int i = 7; /* count(2) */
+ return 0; /* count(2) */
+}
+
+// { dg-final { run-gcov branches calls { -b gcov-pr86536.c } } }