This is an archive of the discontinued LLVM Phabricator instance.

[Fortran] Flexible matching for long character constant in FCVS FM905
Needs ReviewPublic

Authored by rovka on Aug 12 2022, 2:34 AM.

Details

Summary

FM905 uses list-directed output for printing a long character constant.
By default, flang splits the constant when it reaches a line length of
80, whereas gfortran leaves it all on one line.

I couldn't find a clear way to tell flang to never introduce newlines,
nor a way to force a line length for gfortran. However, flang's line
length can be controlled via an environment variable called
FORT_FMT_RECL, so this patch updates the reference output to leave the
line unsplit (as gfortran would print it), and to set FORT_FMT_RECL to
1000 unless otherwise defined in the environment (which will effectively
cause flang to dump the whole constant on one line).

Diff Detail

Event Timeline

rovka created this revision.Aug 12 2022, 2:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2022, 2:34 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript
rovka requested review of this revision.Aug 12 2022, 2:34 AM