aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/allocatable_function_9.f9017
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 30bd3a2..248f933 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..483c1ba
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocatable_function_9.f90
@@ -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