This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran, testsuite] Don't give excess errors for multiple locion the same line
- From: Tobias SchlÃter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Steven Bosscher <stevenb at suse dot de>
- Cc: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>,Andrew Pinski <pinskia at physics dot uc dot edu>, fortran at gcc dot gnu dot org,patch <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 21 Feb 2005 17:30:30 +0100
- Subject: Re: [gfortran, testsuite] Don't give excess errors for multiple locion the same line
- References: <20050219211719.GA1824@troutmask.apl.washington.edu> <2353e4e423d508475d99136aff789ba7@physics.uc.edu> <20050219213353.GA6992@troutmask.apl.washington.edu> <4218BEB4.1030400@physik.uni-muenchen.de> <4218C385.5030900@physik.uni-muenchen.de> <4218E400.30009@physik.uni-muenchen.de> <6333318.1108981088890.SLOX.WebMail.wwwrun@extimap.suse.de>
Steven Bosscher wrote:
> Looks interesting and very useful. My regexp magic is not very
> good, so I don't want to comment on that ;-)
Michael Chamberlain provided me off list with some insight into the wonders of
TCL string syntax. I'm committing this as obvious after making sure that the
testsuite still functions correctly.
- Tobi
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/ChangeLog,v
retrieving revision 1.5062
diff -u -p -r1.5062 ChangeLog
--- ChangeLog 21 Feb 2005 14:55:34 -0000 1.5062
+++ ChangeLog 21 Feb 2005 16:24:48 -0000
@@ -1,4 +1,8 @@
-2005-01-31 Jeff Law <law@redhat.com>
+2005-02-21 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * lib/gfortran-dg.exp (gfortran-dg-test): Split long regexps.
+
+2005-02-21 Jeff Law <law@redhat.com>
* gcc.dg/tree-ssa/20041122-1.c: New test for missing optimization.
Index: lib/gfortran-dg.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/gfortran-dg.exp,v
retrieving revision 1.4
diff -u -p -r1.4 gfortran-dg.exp
--- lib/gfortran-dg.exp 21 Feb 2005 13:03:06 -0000 1.4
+++ lib/gfortran-dg.exp 21 Feb 2005 16:24:48 -0000
@@ -55,8 +55,17 @@ proc gfortran-dg-test { prog do_what ext
# [name]:[line2]: Error: Some error at (1) and (2)
# We proceed in two steps: first we deal with the form with two
# different locus lines, then with the form with only one locus line.
- regsub -all " In file (\[^\n\]*)\n\n\[^\n\]*\n\[^\n\]*\n In file
(\[^\n\]*)\n\n\[^\n\]*\n\[^\n\]*\n(\[^\n\]*)\n" $comp_output "\\1: \\3\n\\2:
\\3\n" comp_output
- regsub -all " In file (\[^\n\]*)\n\n\[^\n\]*\n\[^\n\]*\n(\[^\n\]*)\n"
$comp_output "\\1: \\2\n" comp_output
+ #
+ # Note that these regexps only make sense in the combinations used below.
+ # Note also that is imperative that we first deal with the form with
+ # two loci.
+ set locus_regexp " In file (\[^\n\]*)\n\n\[^\n\]*\n\[^\n\]*\n"
+ set diag_regexp "(\[^\n\]*)\n"
+
+ set two_loci "$locus_regexp$locus_regexp$diag_regexp"
+ set single_locus "$locus_regexp$diag_regexp"
+ regsub -all $two_loci $comp_output "\\1: \\3\n\\2: \\3\n" comp_output
+ regsub -all $single_locus $comp_output "\\1: \\2\n" comp_output
return [list $comp_output $output_file]
}