1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
3 ! Check for semantic errors in DEALLOCATE statements
12 INTEGER, PARAMETER :: maxvalue
=1024
21 Type(t
),Allocatable
:: x(:)
25 Integer, Parameter :: const_s
= 13
29 Procedure(Real) :: prp
36 !ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
39 !ERROR: name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
42 !ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
43 !ERROR: name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
44 Deallocate(x(2)%p
, pi
)
46 !ERROR: name in DEALLOCATE statement must be a variable name
49 !ERROR: name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
50 !ERROR: name in DEALLOCATE statement must be a variable name
53 !ERROR: name in DEALLOCATE statement must be a variable name
56 !ERROR: component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
59 !ERROR: STAT may not be duplicated in a DEALLOCATE statement
60 Deallocate(x
, stat
=s
, stat
=s
)
61 !ERROR: STAT variable 'const_s' must be definable
62 Deallocate(x
, stat
=const_s
)
63 !ERROR: ERRMSG may not be duplicated in a DEALLOCATE statement
64 Deallocate(x
, errmsg
=ee
, errmsg
=ee
)
65 !ERROR: STAT may not be duplicated in a DEALLOCATE statement
66 Deallocate(x
, stat
=s
, errmsg
=ee
, stat
=s
)
67 !ERROR: ERRMSG may not be duplicated in a DEALLOCATE statement
68 Deallocate(x
, stat
=s
, errmsg
=ee
, errmsg
=ee
)
70 End Program deallocatetest