This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] PR32124 - Don't give a run-time error if stat= has been specified for ALLOCATE


Hi,

Thomas Koenig wrote:
> FX already beat me to OKing this patch, but I still think it would be
> nice if you added a test case :-)
>   
I don't know whether the allocation fails on all platforms but it fail
one mine.
Ok for the trunk?

Tobias
2007-05-28  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32124
	* gfortran.dg/allocate_stat_1.f90: New.

Index: gcc/testsuite/gfortran.dg/allocate_stat_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/allocate_stat_1.f90	(Revision 0)
+++ gcc/testsuite/gfortran.dg/allocate_stat_1.f90	(Revision 0)
@@ -0,0 +1,17 @@
+! { dg-do run }
+! Check whether uppon failure no run-time error is issued.
+! PR fortran/32124
+!
+program mem
+  implicit none
+  real(8), allocatable :: A(:,:,:,:)
+  integer :: status
+
+  status = 0
+  allocate(A(huge(0),huge(0),huge(0),huge(0)),stat=status) ! this should fail
+  if(status == 0) call abort()
+
+  status = 0
+  deallocate(A,stat=status)
+  if(status == 0) call abort()
+end program mem

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]