URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [allocate.f90] - Rev 303
Compare with Previous | Blame | View Log
! Test allocation and deallocation.program test_allocatecall t1 (.true.)call t1 (.false.)call t2contains! Implicit deallocation and saved aloocated variables.subroutine t1(first)real, allocatable, save :: p(:)real, allocatable :: q(:)logical firstif (first) thenif (allocated (p)) call abort ()elseif (.not. allocated (p)) call abort ()end ifif (allocated (q)) call abort ()if (first) thenallocate (p(5))elsedeallocate (p)end ifallocate (q(5))end subroutine! Explicit deallocation.subroutine t2()real, allocatable :: r(:)allocate (r(5))pr = 1.0deallocate (r)if (allocated(r)) call abort ()end subroutineend program
