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.
15 lines
420 B
Fortran
15 lines
420 B
Fortran
! RUN: %flang_fc1 -E -fno-reformat -pedantic %s 2>&1 | FileCheck %s
|
|
! CHECK: Label digit is not in fixed-form label field
|
|
1 continue
|
|
! CHECK: Label digit is not in fixed-form label field
|
|
1 2 continue
|
|
! CHECK-NOT: Label is not in fixed-form label field
|
|
con
|
|
3 tinue
|
|
! CHECK: Character in fixed-form label field must be a digit
|
|
end
|
|
! CHECK: 1continue
|
|
! CHECK: 12continue
|
|
! CHECK: continue
|
|
! CHECK: end
|