This is the mail archive of the 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]

Re: A patch for gcc.misc-tests/mg.exp.

On Sun, Sep 10, 2000 at 09:36:14PM +1000, Michael Chamberlain wrote:
> On Wed, Sep 06, 2000 at 04:25:03PM -0700, H . J . Lu wrote:
> > I was trying to figure out why gcc.misc-tests/mg.exp failed under
> > RedHat 7.0 beta. It turned out it had tcl 8.3.1. You have to use
> > braces for regular expression:
> > 
> >
> Unless tcl has changed very much since I last used it, it shouldn't be
> necessary to use braces- it just happens that it is the easiest way to
> avoid all sorts of horrible quoting problems (as you can see below...).
> > For some reason, it doesn't work with tcl 8.0.5. I don't know enough
> > about tcl to fix it right. I hope this will give someone a clue to
> > do it right.
> I can't test the change, and I'm not entirely sure what the expression is
> trying to match, but I think the below would be a safe change that would
> work with both tcl versions:
> set compiler_output "mg.o ?: .*mg.c \[ \\\\\n\]*nonexist.h"
>                                        ^^ new
> The reasoning is that, after processing the string, we will end up with a
> regexp looking like
> "mg.o ?: .*mg.c [ \\<newline>]*nonexist.h"
> where <newline> is an actual newline. This should work with tcl <8.1,
> because we can match a space, or a backslash, or a backslash, or a newline.
> It should also work with tcl >=8.1, because we match with a space, a
> backslash (that was represented by "\\"), and a newline.
> As I don't have the appropriate means to check the change, or do anything
> else to get this included, please do what you think is appropriate to get
> it included (assuming it does work),

Thanks. It works for me on RedHat 7.0 beta. Here is the patch.

H.J. Lu (
2000-09-10  Michael Chamberlain <>

	* gcc.misc-tests/mg.exp (compiler_output): Support tcl 8.3.1.

Index: gcc/testsuite/gcc.misc-tests/mg.exp
RCS file: /work/cvs/gnu/egcs/gcc/testsuite/gcc.misc-tests/mg.exp,v
retrieving revision
diff -u -p -r1.1.1.1 mg.exp
--- gcc/testsuite/gcc.misc-tests/mg.exp	2000/08/07 01:35:22
+++ gcc/testsuite/gcc.misc-tests/mg.exp	2000/09/06 23:16:00
@@ -23,5 +23,5 @@ load_lib mike-gcc.exp
 set actions none-of-the-above
-set compiler_output "mg.o ?: .*mg.c \[ \\\n\]*nonexist.h"
+set compiler_output {mg.o ?: .*mg.c [ \\\n]*nonexist.h}
 postbase mg.c "" "" "-MM -MG"

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