This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] testsuite/gcc.dg/compat changes for debugging output


On Fri, Jun 13, 2003 at 11:04:36AM +0200, Eric Botcazou wrote:
> > This patch changes the debugging output in the existing C binary
> > compatibility tests in gcc.dg/compat.  By default the tests produce
> > no output and abort as soon as an error is detected.  When compiled
> > with -DDBG, they print output that helps to determine where problems
> > occur.  The output is now more clear, and a failing test now aborts
> > at the end of the test rather than when the first error is detected.
> 
> I'm having some problems with this (very useful btw) feature on SPARC: the 
> FAILures are not expanded, whereas the PASSes are. Log file attached.
> 
> Could this be a DejaGNU bug?

I suspect that the test is aborting early and the output isn't being
flushed, although on a GNU/Linux system I had a test that was getting
a segfault but I still got the output.  You could run it with a debugger
to see if it's aborting via the call to abort(), or earlier with some
other problem.

What happens when you compile and run the test directly, rather than
as part of the test suite?  Is there a difference between running it
in the background with the output redirected and running it in the
foreground without redirecting the output?  If the output isn't being
flushed when the test aborts early, does the following patch fix it?

Janis

Index: gcc.dg/compat/compat-common.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/compat/compat-common.h,v
retrieving revision 1.1
diff -u -p -r1.1 compat-common.h
--- gcc.dg/compat/compat-common.h	10 Jun 2003 19:08:33 -0000	1.1
+++ gcc.dg/compat/compat-common.h	13 Jun 2003 16:34:12 -0000
@@ -6,11 +6,12 @@
  
 #ifdef DBG
 #include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#define DEBUG_FAIL putc ('F', stdout); fails++
-#define DEBUG_CHECK { DEBUG_FAIL; } else { DEBUG_DOT; }
+#define DEBUG_FFLUSH fflush (stdout)
+#define DEBUG_FPUTS(x) { fputs (x, stdout); DEBUG_FFLUSH; }
+#define DEBUG_DOT { putc ('.', stdout); DEBUG_FFLUSH; }
+#define DEBUG_NL { putc ('\n', stdout); DEBUG_FFLUSH; }
+#define DEBUG_FAIL { putc ('F', stdout); DEBUG_FFLUSH; fails++; }
+#define DEBUG_CHECK DEBUG_FAIL else DEBUG_DOT
 #else
 #define DEBUG_FPUTS(x)
 #define DEBUG_DOT


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]