llvm-project/flang/test/Parser/excessive-continuations.f90
Peter Klausler 1c91d9bdea
[flang] Ensure that portability warnings are conditional (#71857)
Before emitting a warning message, code should check that the usage in
question should be diagnosed by calling ShouldWarn(). A fair number of
sites in the code do not, and can emit portability warnings
unconditionally, which can confuse a user that hasn't asked for them
(-pedantic) and isn't terribly concerned about portability *to* other
compilers.

Add calls to ShouldWarn() or IsEnabled() around messages that need them,
and add -pedantic to tests that now require it to test their portability
messages, and add more expected message lines to those tests when
-pedantic causes other diagnostics to fire.
2023-11-13 16:13:50 -08:00

263 lines
1.5 KiB
Fortran

! RUN: %flang_fc1 -fdebug-unparse -pedantic %s 2>&1 | FileCheck %s
! CHECK: portability: 256 continuation lines is more than the Fortran standard allows
! CHECK: LOGICAL, PARAMETER :: c255 = .true._4
program test
logical, parameter :: c255 = 255 == len("&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a&
&a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