view gcc/testsuite/gfortran.dg/allocatable_scalar_6.f90 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { dg-do run }
! { dg-options "-Wall -pedantic" }
!
! PR fortran/41872
!
!  (De)allocate tests
!
program test
  implicit none
  integer, allocatable :: a, b, c
  integer :: stat
  stat=99
  allocate(a, stat=stat)
  if (stat /= 0) STOP 1
  allocate(a, stat=stat)
  if (stat == 0) STOP 2

  allocate (b)
  deallocate (b, stat=stat)
  if (stat /= 0) STOP 3
  deallocate (b, stat=stat)
  if (stat == 0) STOP 4

  deallocate (c, stat=stat)
  if (stat == 0) STOP 5
end program test