llvm-project/flang/test/Semantics/declarations07.f90
Andre Kuhlenschmidt 83b462af17
[flang][CLI] Have the CLI hint the flag to disable a warning (#144767)
Adds a hint to the warning message to disable a warning and updates the
tests to expect this.

Also fixes a bug in the storage of canonical spelling of error flags so
that they are not used after free.
2025-06-30 10:17:05 -07:00

19 lines
685 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror
! A nasty case of a weird order of declarations - a symbol may appear
! as an actual argument to a specification function before its rank
! has been declared.
program main
interface kind
pure integer function mykind(x)
real, intent(in) :: x(:)
end
end interface
real a, b
integer, parameter :: ak = kind(a)
integer, parameter :: br = rank(b)
!WARNING: 'a' appeared earlier as a scalar actual argument to a specification function [-Wprevious-scalar-use]
dimension a(1)
!WARNING: 'b' appeared earlier as a scalar actual argument to a specification function [-Wprevious-scalar-use]
dimension b(1)
end