xref: /llvm-project/flang/test/Semantics/deallocate06.f90 (revision fb792ebaf2114ad11d673cf891ae560e2e604711)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2
3! Test deallocate of use- and host-associated variables
4module m1
5  real, pointer :: a(:)
6  real, allocatable :: b(:)
7end
8
9subroutine s1()
10  use m1
11  complex, pointer :: c(:)
12  complex, allocatable :: d(:)
13  complex :: e(10)
14  deallocate(a)
15  deallocate(b)
16contains
17  subroutine s2()
18    deallocate(a)
19    deallocate(b)
20    deallocate(c)
21    deallocate(d)
22    !ERROR: Name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
23    deallocate(e)
24  end subroutine
25end
26