view gcc/testsuite/gfortran.dg/deallocate_error_2.f90 @ 118:fd00160c1b76

ifdef TARGET_64BIT
author mir3636
date Tue, 27 Feb 2018 15:01:35 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do run }
! { dg-shouldfail "runtime error" }
! { dg-output "At line 15.*Attempt to DEALLOCATE unallocated 'ptr'" }

! PR fortran/37507
! Check that locus is printed for DEALLOCATE errors.

PROGRAM main
  IMPLICIT NONE
  INTEGER, POINTER :: ptr
  INTEGER, ALLOCATABLE :: arr(:)

  ALLOCATE (ptr, arr(5))
  DEALLOCATE (ptr)
  DEALLOCATE (arr, ptr)
END PROGRAM main