RTEMS FORTRAN Pattern Failures

Tobias Burnus burnus@net-b.de
Mon Jan 12 19:14:00 GMT 2015


Joel Sherrill wrote:
> On 1/12/2015 10:30 AM, Andreas Schwab wrote:
>> Joel Sherrill <joel.sherrill@oarcorp.com> writes:
>>
>>> FAIL: gfortran.dg/g77/f77-edit-x-out.f  -Os  output pattern test, is 1 2  3
>>> 1 2  3
>>>
>>> , should match ^1 2  3(
>>> |
>>> |)1 2  3(
>>> |
>>> |)$
>> Where is the \r gone?  The pattern has (\n|\r\n|\r).
> I am not exactly sure what you mean but when I run the test
> by itself from the command and redirect the output to a file,
> this is what the output looks like:
>
> 0000000    2031    2032    3320    0a0d    2031    2032    3320    0a0d
> 0000000   1       2           3  \r  \n   1       2           3  \r  \n
> 0000010    0a0d    2a2a    202a    5845    5449    6320    646f    2065
> 0000010  \r  \n   *   *   *       E   X   I   T       c   o   d   e
> 0000020    0d30    000a
> 0000020   0  \r  \n
> 0000023
>
> It looks like we have \r\n at the end of each line.
>
> Is it possible it is not CR/LF but the EXIT code message confusing the
> pattern?

Contrary to Andreas, I do see \r in run.txt – at least when I look at 
the file when saved from Thunderbird. Namely, the output is (sp = space, 
nl = \n, cr = \r):

1 sp 2 sp sp 3 cr cr nl
1 sp 2 sp sp 3 cr cr nl
cr cr nl
*** EXIT code 0 cr cr nl

Namely: I do not see CR-NL but CR-CR-NL. That looks rather odd and does 
not match what you get when you manually run the program. Looing at 
other lines like "spawn sis -i ./f77-edit-x-out.exe", they have a CR-NL, 
i.e. only a single CR. Thus, the question is what inserts an additional 
"\r" into the output.

Additionally, I think you are right that the "*** EXIT code 0" also 
causes problems with 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.

If (b) works [alone or together with (a)]: Any chance that you silence 
the "\r\r\n*** EXIT code 0\r\r\n" output? I think it could potentially 
confuse other test cases and it doesn't belong there. – I am also 
inclined not to remove the '\$', unless there are very compelling 
reasons to do so.


Tobias



More information about the Gcc mailing list