1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for semantic errors in DEALLOCATE statements
11 INTEGER, PARAMETER :: maxvalue
=1024
20 Type(t
),Allocatable
:: x(:)
24 Integer, Parameter :: const_s
= 13
28 Procedure(Real) :: prp
35 !ERROR: Component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
38 !ERROR: Name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
41 !ERROR: Component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
42 !ERROR: Name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
43 Deallocate(x(2)%p
, pi
)
45 !ERROR: Name in DEALLOCATE statement must be a variable name
48 !ERROR: Name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
49 !ERROR: Name in DEALLOCATE statement must be a variable name
52 !ERROR: Name in DEALLOCATE statement must be a variable name
55 !ERROR: Component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute
58 !ERROR: STAT may not be duplicated in a DEALLOCATE statement
59 Deallocate(x
, stat
=s
, stat
=s
)
60 !ERROR: STAT variable 'const_s' is not definable
61 !BECAUSE: '13_4' is not a variable or pointer
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