When a constant array value has a non-default lower bound, the current expression formatting code uses a non-Fortran syntax to dump the lower bounds. (There's no way in Fortran to explicitly specify such a constant value, but they can be created through the use of named constants.) But we don't want this lower bounds syntax from expression dumping to show up in module files, since it can't be parsed back in. So disable that part of expression formatting by default. Fixes https://github.com/llvm/llvm-project/issues/64391. Differential Revision: https://reviews.llvm.org/D157330
11 lines
226 B
Fortran
11 lines
226 B
Fortran
! RUN: %python %S/test_modfile.py %s %flang_fc1
|
|
! Named constant array with non-default lower bound
|
|
module m
|
|
real, parameter :: x(0:0) = [0.]
|
|
end
|
|
|
|
!Expect: m.mod
|
|
!module m
|
|
!real(4),parameter::x(0_8:0_8)=[REAL(4)::0._4]
|
|
!end
|