xref: /llvm-project/flang/test/Semantics/deallocate04.f90 (revision 6c1ac141d3c98af9738bc77fcb55602cbff7751f)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2! Check for type errors in DEALLOCATE statements
3
4INTEGER, PARAMETER :: maxvalue=1024
5
6Type dt
7  Integer :: l = 3
8End Type
9Type t
10  Type(dt) :: p
11End Type
12
13Type(t),Allocatable :: x
14
15Real :: r
16Integer :: s
17Integer :: e
18Integer :: pi
19Character(256) :: ee
20Procedure(Real) :: prp
21
22Allocate(x)
23
24!ERROR: Must have CHARACTER type, but is INTEGER(4)
25Deallocate(x, stat=s, errmsg=e)
26
27!ERROR: Must have INTEGER type, but is REAL(4)
28!ERROR: Must have CHARACTER type, but is INTEGER(4)
29Deallocate(x, stat=r, errmsg=e)
30
31End Program
32