This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: testsuite/gcc.misc-tests/mg.exp
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Subject: [PATCH]: testsuite/gcc.misc-tests/mg.exp
- From: Donn Terry <donn at interix dot com>
- Date: Fri, 10 Sep 1999 15:19:42 -0600
(Mostly housekeeping.)
--
===================================================
Donn Terry mailto:donn@interix.com
Softway Systems, Inc. http://www.interix.com
2850 McClelland Dr, Ste. 1800 Ft.Collins CO 80525
Tel: +1-970-204-9900 Fax: +1-970-204-9951
===================================================
mg.exp regression passes, but complains about "2>/dev/null" not existing.
"2>/dev/null" is not being interpreted by the shell, and is being treated
as a relative pathname, not a redirection.
Details:
1) mg.exp calls postbase with the 4th argument (options) of
"-MM -MG 2>/dev/null".
2) After various calls and translations, this gets to dejagnu/lib/target.exp
default_target_compile, where options is:
{compiler=//D/home/donn.intel/gnu2.intel/egcs.bin/gcc/xgcc -B//D/home/donn.intel/gnu2.intel/egcs.bin/gcc/} {additional_flags=-MM -MG 2>/dev/null} {compiler=//D/home/donn.intel/gnu2.intel/egcs.bin/gcc/xgcc -B//D/home/donn.intel/gnu2.intel/egcs.bin/gcc/}
Note that "additional_flags" contains the redirection operator 2>/dev/null.
This becomes the variable opts (also add_flags), which just before the
call to remote_exec in default_target_compile has the value:
-MM -MG 2>/dev/null
3) In remote.exp/remote_exec, this becomes the argument "program", and
becomes part of the first arg to the call to local_exec.
Reading the comments in local_exec, it appears that:
a) the redirection should have come in as the outp argument anyway
(or maybe there isn't a place for stderr redirections at all).
b) The presence of stderr redirection may have been to work around
a bug in TCL's exec that is now handled by local_exec.
In any case, this isn't prepared to handle a redirection as part of the
command (a spawn call at about line 96). Expect's spawn function
ends up calling execvp of the command (not system() or something else
that involves a shell). Thus, "2>/dev/null" will be seen as an
argument, not a redirection.
After all that, it appears that the fix is simply to take the redirection
out of mg.exp, because doing so causes the test to pass cleanly, and
there's at least a case to be made for deleting it as a historical artifact.
ChangeLog:
* gcc.misc-tests/mg.exp: delete extraneous redirection.
diff -urP egcs.source.old/gcc/testsuite/gcc.misc-tests/mg.exp egcs.source/gcc/testsuite/gcc.misc-tests/mg.exp
--- egcs.source.old/gcc/testsuite/gcc.misc-tests/mg.exp.old Tun Jul 22 10:22:50 1999
+++ egcs.source/gcc/testsuite/gcc.misc-tests/mg.exp Tun Jul 22 14:06:10 1999
@@ -24,4 +24,4 @@ load_lib mike-gcc.exp
prebase
set actions none-of-the-above
set compiler_output "mg.o ?: .*mg.c \[ \\\n\]*nonexist.h"
-postbase mg.c "" "" "-MM -MG 2>/dev/null"
+postbase mg.c "" "" "-MM -MG"