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]

RFA: Don't pass DMGL_VERBOSE to cplus_demangle() when testing.


The libiberty demangler testsuite passes DMGL_VERBOSE to
cplus_demangle().  This makes no difference for the older demangler
code.  For the newer v3 demangler, it causes the demangler to generate
more verbose output.

The testsuite, however, expects the less verbose output.  For example,
consider this test 

--format=gnu-v3
_ZngILi42EEvN1AIXplT_Li2EEE1TE
void operator-<42>(A<(42) + (2)>::T)

When the demangler is invoked without DMGL_VERBOSE, it produces this
output:

void operator-<42>(A<(42)+(2)>::T)

which is identical to the expected result except for inconsequential
whitespace.

When the demangler is invoked with DMGL_VERBOSE, it produces this
output:

void operator-<(int)42>(A<((int)42)+((int)2)>::T)

We need to either not use DMGL_VERBOSE, or change some of the expected
tests.  Since the C++ version of the demangler generates the result
found in demangle-expected, I think the simplest approach is to not
pass DMGL_VERBOSE to cplus_demangle().

This is done in the appended trivial patch.

Ian


2003-11-18  Ian Lance Taylor  <ian@wasabisystems.com>

	* testsuite/test-demangle.c (main): Don't pass DMGL_VERBOSE to
	cplus_demangle.


Index: test-demangle.c
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/testsuite/test-demangle.c,v
retrieving revision 1.2
diff -u -r1.2 test-demangle.c
--- test-demangle.c	5 Jun 2003 16:38:22 -0000	1.2
+++ test-demangle.c	18 Nov 2003 17:21:03 -0000
@@ -146,7 +146,7 @@
       cplus_demangle_set_style (style);
 
       result = cplus_demangle (input.data,
-			       DMGL_PARAMS|DMGL_ANSI|DMGL_VERBOSE|DMGL_TYPES);
+			       DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES);
 
       if (result
 	  ? strcmp (result, expect.data)


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