unreviewed C++ testsuite patch

Janis Johnson janis187@us.ibm.com
Mon Sep 17 13:47:00 GMT 2001


Last week I submitted a patch for new C++ test directories for tests
of gcov and -fbranch-probabilities.  It hasn't yet been reviewed:
http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00411.html .

Meanwhile, I've discovered that one of the gcov tests doesn't really
test what I wanted it to test, so I've got a replacement for that test.
The files gcov-3.C and gcov-3.h here replace gcov-3.C and gcov-3.x from
the original submittal.  For testing gcov it doesn't work to use a
single preprocessed test file; gcov needs access to the original source
files.

I'll send new information to gcc-bugs about PR 3639, which relates to
this test.

Can I commit the new C++ tests for gcov and -fbranch-probabilities,
with this change?

Janis

2001-09-17  Janis Johnson  <janis187@us.ibm.com>

	* g+.dg/special/gcov/gcov-3.C: New test.
	* g+.dg/special/gcov/gcov-3.h: New file.

--- g++.dg/special/gcov/gcov-3.C.orig	Fri Aug 31 10:16:35 2001
+++ g++.dg/special/gcov/gcov-3.C	Mon Sep 17 13:34:54 2001
@@ -0,0 +1,17 @@
+/* Check that gcov doesn't abort when a static object is defined
+   within a header file.  */
+
+/* { dg-options "-fprofile-arcs -ftest-coverage" } */
+/* { dg-do run { target native } } */
+
+#include "gcov-3.h"
+
+extern int foo();
+
+int
+main ()
+{
+  return foo();				/* count(1) */
+}
+
+/* { dg-final { run-gcov gcov-3.C } } */
--- g++.dg/special/gcov/gcov-3.h.orig	Fri Aug 31 10:16:35 2001
+++ g++.dg/special/gcov/gcov-3.h	Mon Sep 17 13:36:03 2001
@@ -0,0 +1,31 @@
+/* Leave unused lines for at least the length of the including source file. */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct T {
+  int i;
+  T() { i = 0; }
+};
+
+T t;
+
+int foo()
+{
+  return t.i;				/* count(1) */
+}



More information about the Gcc-patches mailing list