aboutsummaryrefslogtreecommitdiff
blob: 8e26f61d3508e3ae020e65318d931257e0dad323 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
! RUN: %S/test_errors.sh %s %t %flang_fc1
! Check for type errors in DEALLOCATE statements

INTEGER, PARAMETER :: maxvalue=1024

Type dt
  Integer :: l = 3
End Type
Type t
  Type(dt) :: p
End Type

Type(t),Allocatable :: x

Real :: r
Integer :: s
Integer :: e
Integer :: pi
Character(256) :: ee
Procedure(Real) :: prp

Allocate(x)

!ERROR: Must have CHARACTER type, but is INTEGER(4)
Deallocate(x, stat=s, errmsg=e)

!ERROR: Must have INTEGER type, but is REAL(4)
!ERROR: Must have CHARACTER type, but is INTEGER(4)
Deallocate(x, stat=r, errmsg=e)

End Program