brintos

brintos / llvm-project-archived public Read only

0
0
Text · 850 B · b224f30 Raw
50 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Test that DEALLOCATE works3 4INTEGER, PARAMETER :: maxvalue=10245 6Type dt7  Integer :: l = 38End Type9Type t10  Type(dt),Pointer :: p11End Type12 13Type(t),Allocatable :: x(:)14Type(t),Pointer :: y(:)15Type(t),Pointer :: z16Integer :: s17CHARACTER(256) :: e18 19Integer, Pointer :: pi20 21Allocate(pi)22Allocate(x(3))23 24Deallocate(x(2)%p)25 26Deallocate(y(2)%p)27 28Deallocate(pi)29 30Deallocate(z%p)31 32!ERROR: An allocatable or pointer component reference must be applied to a scalar base33Deallocate(x%p, stat=s, errmsg=e)34Deallocate(x, errmsg=e)35Deallocate(x, stat=s)36 37Deallocate(y, stat=s, errmsg=e)38Deallocate(y, errmsg=e)39Deallocate(y, stat=s)40 41Deallocate(z, stat=s, errmsg=e)42Deallocate(z, errmsg=e)43Deallocate(z, stat=s)44 45Deallocate(z, y, stat=s, errmsg=e)46Deallocate(z, y, errmsg=e)47Deallocate(z, y, stat=s)48 49End Program50