I tested gfortran and flang(old). https://godbolt.org/z/c89foro4G
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The "Lw" edit descriptor already works in Flang. A bare "L" edit descriptor is an extension which you'll need to document. Also please ensure with tests that a bare "L" edit descriptor can be used in a FORMAT statement.
Please test with "L" embedded in a CHARACTER that is used as a format.
The extensions document is flang/docs/Extensions.md
Thanks @sunshaoce for the patch. I have a comment about the location of the test.
flang/test/Driver/print-logical.f90 | ||
---|---|---|
3 ↗ | (On Diff #508933) | Execution tests are not put in the flang/test/Driver directory. If you want to test execution then the best places are:
Please look at similar tests in this area. |
It seems that IFX and IFORT can only format logical types. For pgfortran, if someone can help test, it would be much appreciated.
It works for GNU Fortran, the Intel compilers, nvfortran, and XLF. It does not work with NAG. So it's worth doing.
The 22.1 version of nvfortran worked for logicals and integers. It did not work for strings and reals.
gfortran's and nvfortran's interpretation of integers seems to be different for the L format.
BTW, thanks for moving the test to unittests/Runtime/LogicalFormatTest.cpp.