Add PR fortran/55603 working test
authorMikael Morin <mikael@gcc.gnu.org>
Fri, 25 Sep 2015 20:28:33 +0000 (20:28 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Fri, 25 Sep 2015 20:28:33 +0000 (20:28 +0000)
gcc/testsuite/
PR fortran/55603
* gfortran.dg/allocatable_function_9.f90: New.

From-SVN: r228151

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/allocatable_function_9.f90 [new file with mode: 0644]

index 30bd3a264b43df2d8ae5980f6badb06f23a4ac11..248f933ac1ea30c29112fa983578ab143100be26 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-25  Mikael Morin  <mikael@gcc.gnu.org>
+
+       PR fortran/55603
+       * gfortran.dg/allocatable_function_9.f90: New.
+
 2015-09-25  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/67675
diff --git a/gcc/testsuite/gfortran.dg/allocatable_function_9.f90 b/gcc/testsuite/gfortran.dg/allocatable_function_9.f90
new file mode 100644 (file)
index 0000000..483c1ba
--- /dev/null
@@ -0,0 +1,17 @@
+! { dg-do run }
+!
+! PR fortran/55603
+! Check that the allocatable result is properly freed after use.
+!
+! Contributed by Damian Rouson <damian@sourceryinstitute.org>
+
+  type foo
+  end type
+  type(foo) a
+  a = bar()
+contains
+  function bar()
+    type(foo), allocatable :: bar
+    allocate(bar)
+  end function
+end