mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 16:26:42 +00:00

The pointers and allocatables that appear in ALLOCATE and DEALLOCATE statements need to be subject to the general definability checks so that problems with e.g. PROTECTED objects can be caught. (Also: regularize the capitalization of the DEALLOCATE error messages while I'm in here so that they're consistent with the messages that can come out for ALLOCATE.) Differential Revision: https://reviews.llvm.org/D140149
26 lines
531 B
Fortran
26 lines
531 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
|
|
! Test deallocate of use- and host-associated variables
|
|
module m1
|
|
real, pointer :: a(:)
|
|
real, allocatable :: b(:)
|
|
end
|
|
|
|
subroutine s1()
|
|
use m1
|
|
complex, pointer :: c(:)
|
|
complex, allocatable :: d(:)
|
|
complex :: e(10)
|
|
deallocate(a)
|
|
deallocate(b)
|
|
contains
|
|
subroutine s2()
|
|
deallocate(a)
|
|
deallocate(b)
|
|
deallocate(c)
|
|
deallocate(d)
|
|
!ERROR: Name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
|
|
deallocate(e)
|
|
end subroutine
|
|
end
|