llvm/flang/test/Semantics/deallocate06.f90
Tim Keith d66463eedc [flang] Copy attributes and flags onto host-assoc symbols
As with use-associated symbols, copy the attributes and flags from the
original symbol onto host-associated symbols when they are created.

This was showing up as an error on a deallocate of a host-associated
name. We reported an error because the symbol didn't have the POINTER
or ALLOCATABLE attribute.

Differential Revision: https://reviews.llvm.org/D85763
2020-08-17 07:00:07 -07:00

26 lines
520 B
Fortran

! RUN: %S/test_errors.sh %s %t %f18
! 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