On Tue, Mar 13, 2007 at 02:07:02PM -0800, Janis Johnson wrote:
> On Tue, Mar 13, 2007 at 02:22:06PM -0700, Jim Wilson wrote:
> > Revital1 Eres wrote:
> > >ERROR: tcl error sourcing
> > >/home/eres/mve_mainline_zero_12_3/gcc/gcc/testsuite/g++.dg/compat/compat.exp.
> > >ERROR: couldn't open
> > >"/home/eres/mve_xline_zero_12_3/gcc/gcc/testsuite/g++.dg/compat/abi/bitfield1_main.C":
> >
> > Note that mainline got changed to xline. Also note that the directory
> > has files bitfield_main.C, bitfield_x.C, and bitfield_y.C.
> >
> > So it looks like there is a tcl script somewhere to replace "main" with
> > "x", which fails if the directory path contains "main" anywhere in it
> > other than in the filename at the end.
>
> That is indeed the problem; testsuite/lib/compat.exp contains
>
> # Set up the names of the other source files.
> regsub "_main.*" $src1 "" base
> regsub ".*/" $base "" base
> regsub "_main" $src1 "_x" src2
> regsub "_main" $src1 "_y" src3
>
> I'll find a way to fix that.
Revital, please try this. I've tested it but know better than to check
things in at the end of the day; I'll post it tomorrow.
Index: gcc/testsuite/lib/compat.exp
===================================================================
--- gcc/testsuite/lib/compat.exp (revision 122875)
+++ gcc/testsuite/lib/compat.exp (working copy)
@@ -259,10 +259,13 @@
}
# Set up the names of the other source files.
- regsub "_main.*" $src1 "" base
- regsub ".*/" $base "" base
- regsub "_main" $src1 "_x" src2
- regsub "_main" $src1 "_y" src3
+ set dir [file dirname $src1]
+ set ext [file extension $src1]
+ set base [file rootname $src1]
+ set base [string range $base [string length $dir] end]
+ regsub "_main" $base "" base
+ set src2 "${dir}/${base}_x${ext}"
+ set src3 "${dir}/${base}_y${ext}"
# Use the dg-options mechanism to specify extra flags for this test.
# The extra flags in each file are used to compile that file, and the