[flang-commits] [flang] [flang] Fix fixed line length overflow diagnostic (PR #233353)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Mon Oct 19 11:50:28 PDT 2026
================
@@ -7,6 +7,7 @@
! RUN: not %flang -E -Xflang -fno-reformat -ffixed-line-length=-2 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=NEGATIVELENGTH
! RUN: not %flang -E -Xflang -fno-reformat -ffixed-line-length=3 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=INVALIDLENGTH
! RUN: not %flang -E -Xflang -fno-reformat -ffixed-line-length=4294967296 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=OVERFLOWLENGTH
+! RUN: not %flang -E -Xflang -fno-reformat -ffixed-line-length=9223372036854775808 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=INT64OVERFLOW
----------------
eugeneepshteyn wrote:
(This comment was generated with the help of AI)
Please also pin a too-large negative value, as the issue asked. The existing `-2` case parses successfully, so it never reaches the branch this PR changes; without a test, a later change that let a sign through the digits check would move `-99999999999999999999` to the "too large" message unnoticed:
```
! RUN: not %flang -E -Xflang -fno-reformat -ffixed-line-length=-99999999999999999999 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=NEGOVERFLOW
! RUN: not %flang_fc1 -E -fno-reformat -ffixed-line-length=-99999999999999999999 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=NEGOVERFLOW
! NEGOVERFLOW: invalid value '-99999999999999999999' in 'ffixed-line-length=', value must be 'none' or a positive integer
```
https://github.com/llvm/llvm-project/pull/233353
More information about the flang-commits
mailing list