This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RTEMS FORTRAN Pattern Failures
- From: Tobias Burnus <burnus at net-b dot de>
- To: Joel Sherrill <joel dot sherrill at oarcorp dot com>, Andreas Schwab <schwab at suse dot de>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Mon, 12 Jan 2015 21:49:56 +0100
- Subject: Re: RTEMS FORTRAN Pattern Failures
- Authentication-results: sourceware.org; auth=none
- References: <54B3F33D dot 7030207 at oarcorp dot com> <mvmy4p855dh dot fsf at hawking dot suse dot de> <54B3FAD5 dot 3080709 at oarcorp dot com> <54B41D06 dot 7050606 at net-b dot de> <54B42EB0 dot 3060007 at oarcorp dot com>
Joel Sherrill wrote:
run.txt is the cut and paste of the log file which reflects DejaGNU's
view of the run.
Which means that it hopefully matches every bit of the original output
and that no editor interferes by adding or removing line breaks.
Additionally, I think you are right that the "*** EXIT code 0" also
causes problems with the pattern.
Details below but this is standard DejaGNU output when the target
doesn't return
an exit code.
Good to know. If the pattern is known, one can add it to the pattern.
Can you try the following:
a) Replace the pattern by "1 2 3(\n|\r\r\n|\r)" (twice), note the
duplicated "\r"
b) Remove the "dg-output "\$" line
[Best would be if you could try them also separately.] My bet would be
that doing (a) and (b) will succeed, while only (a) and (b) will fail.
If using (a) [alone or together with (b)] works, you should really find
out what inserts the "\r", especially as it does not appear if you
manually run the program. "\r\r\n" is definitely not a pattern I would
like to see in the test file.
I assume the file in question is
gcc/gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f
Yes.
(a) alone didn't make it pass.
(b) alone didn't make it pass.
(a) and (b) together did not make it pass
Does this file get copied or something else during the process that
would eliminate edits having an impact?
I don't think so. Too bad that it didn't seem to help.
Is there an easy way to take out.txt and just force it against this
.exp pattern?
Well, you could try whether PERL is able to match it, i.e. something
like "cat file | perl ..." if you manage to get the exact output into a
file (esp. with the right number of \r and \n, including the last line).
I don't know whether that's really identical but it should come close to
how DejaGNU matches the pattern.
Example - I use printf instead of a file:
printf '1 2 3\n1 2 3\n\n*** EXIT code 0' \
| 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)?$/s) { print
"matched\n" } else { print "not matched\n" };'
Tobias