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

Re: RTEMS FORTRAN Pattern Failures


Hi Joel,

Am 12.01.2015 um 22:04 schrieb Joel Sherrill:
That was very close.

cat out.txt |  \
   perl -e '$in = join("", <STDIN>); if ($in =~ m/^1 2  3(\n|\r\n|\r)1 2
3(\n|\r\n|\r)((\n|\r\n|\r)\*\*\* EXIT code 0)(\n|\r\n|\r)?$/s) { print
"matched\n" } else { print "not matched\n" };'

That won't work on systems which don't print EXIT. You have to move the ")" from after the "0" to before the "?" to make the whole part as optional (the ? applies to the preceding token).

I think I mainly fixed the first line to have two spaces between the 2 and 3
and added another the EOL pattern at the end.

The former was a bug (feature) of Thunderbird, which ate the second space, the second, I forgot.

That just leaves translating that back into DejaGNU/Expect. :)

Well, that's simple: Either remove all "dg-output" from the test case and add the string between "m/" and "/s" instead of ... in

C { dg-output "..." }

You additionally have to change "\*" to "\\*" and "$" to "\$".

Or, alternatively, only modify the last "dg-output" by replacing "\$" by the string starting with "((" and ending with "$". (Again, you have to replace \* by \\* and $ by \$.)

That should be all. I wonder whether that now works or still fails.

Can you try whether this works (see attachment)?

Tobias
diff --git a/gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f b/gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f
index 13a9d7a..4aacd4d 100644
--- a/gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f
+++ b/gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f
@@ -8,5 +8,5 @@ C { dg-output "^" }
       write(*,'(I1,1X,I1,2X,I1)') 1,2,3    ! { dg-output "1 2  3(\n|\r\n|\r)" }
 C Section 13.5.3 explains why there are no trailing blanks
       write(*,'(I1,1X,I1,2X,I1,3X)') 1,2,3 ! { dg-output "1 2  3(\n|\r\n|\r)" }
-C { dg-output "\$" }
+C { dg-output "((\n|\r\n|\r)\\*\\*\\* EXIT code 0(\n|\r\n|\r))?\$" }
       end

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