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]

Committed fix for your r161745 to gfortran.dg/char_bounds_check_fail_1.f90


I don't see the patch for that commit on the gcc-patches@ nor
fortran@ lists.

Anyway, the patch had a formerly hidden (due to the invalid
dg-syntax you fixed) syntax error; an unquoted ')', causing:

Running /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gfortran.dg/dg.exp ...
ERROR: tcl error sourcing /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gfortran.dg/dg.exp.
ERROR: couldn't compile regular expression pattern: parentheses () not balanced
    while executing
"regexp $texttmp ${output}"
    invoked from within
"if ![file exists $output_file] {
	    warning "$name compilation failed to produce executable"
	} else {
	    set status -1
	    set result [${tool}_l..."
    (procedure "saved-dg-test" line 224)
    invoked from within
"saved-dg-test /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gfortran.dg/char_bounds_check_fail_1.f90 { -O0 } { -pedantic-errors}"
    ("eval" body line 1)
    invoked from within
"eval saved-dg-test $args "
    (procedure "dg-test" line 9)
    invoked from within
"dg-test $test $flags ${default-extra-flags}"
    (procedure "gfortran-dg-runtest" line 27)
    invoked from within
"gfortran-dg-runtest [lsort \
       [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ] ] $DEFAULT_FFLAGS"
    (file "/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gfortran.dg/dg.exp" line 32)
    invoked from within
"source /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gfortran.dg/dg.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gfortran.dg/dg.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""

Not only that, but the old text was wrong; the diagnostic
apparently has changed.  AFAICT, the test should pass.  The
diagnostic emitted when testing for cris-elf is:

At line 10 of file /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gfortran.dg/char_bounds_check_fail_1.f90
Fortran runtime error: Substring out of bounds: upper bound (11) of 'zz' exceeds string length (10)

So, I believe it was correct and obvious to commit the following
patch.  You may want to follow-up and remove the exact bound
specifications which weren't present in the old text, but please
be careful about the regexp syntax.  Of course running the
test-suite after the change and inspect the log helps. ;)

BTW, those regexp evaluations really should be in some kind of
"catch"-clause in whatever lib/*.exp, so they don't mess up the
rest of the test-run!  (Which is how I spotted it; a FAIL was
unexpectedly gone.)  Or perhaps reported to bug-dejagnu if it
can't be fixed like that locally.

Commited after observing that the above was fixed.

gcc/testsuite:
	* gfortran.dg/char_bounds_check_fail_1.f90: Correct dg-output string.

Index: gcc/testsuite/gfortran.dg/char_bounds_check_fail_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/char_bounds_check_fail_1.f90	(revision 161765)
+++ gcc/testsuite/gfortran.dg/char_bounds_check_fail_1.f90	(working copy)
@@ -10,4 +10,4 @@
       zz(i:j) = 'abcdef'
       print * , zz
       end
-! { dg-output "Substring out of bounds: upper bound exceeds string length.*at line 9)" }
+! { dg-output "At line 10.*Substring out of bounds: upper bound \\(11\\) of 'zz' exceeds string length" }

brgds, H-P


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