Multiple definitions of a procedure pointer with DATA statements should elicit an error message, not a compiler crash. Fixes https://github.com/llvm/llvm-project/issues/90944.
19 lines
417 B
Fortran
19 lines
417 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
program p
|
|
interface
|
|
subroutine s
|
|
end subroutine
|
|
end interface
|
|
!ERROR: DATA statement initializations affect 'p' more than once
|
|
procedure(s), pointer :: p
|
|
type t
|
|
procedure(s), pointer, nopass :: p
|
|
end type
|
|
!ERROR: DATA statement initializations affect 'x%p' more than once
|
|
type(t) x
|
|
data p /s/
|
|
data p /s/
|
|
data x%p /s/
|
|
data x%p /s/
|
|
end
|