aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/finalize_1.f08
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/finalize_1.f08')
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_1.f0831
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/finalize_1.f08 b/gcc/testsuite/gfortran.dg/finalize_1.f08
new file mode 100644
index 00000000000..e1501ef66b8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_1.f08
@@ -0,0 +1,31 @@
+! { dg-do compile }
+
+! Parsing of finalizer procedure definitions.
+! Check that CONTAINS is allowed in TYPE definition; but empty only for F2008
+
+MODULE final_type
+ IMPLICIT NONE
+
+ TYPE :: mytype
+ INTEGER, ALLOCATABLE :: fooarr(:)
+ REAL :: foobar
+ CONTAINS
+ END TYPE mytype
+
+CONTAINS
+
+ SUBROUTINE bar
+ TYPE :: t
+ CONTAINS ! This is ok
+ END TYPE t
+ ! Nothing
+ END SUBROUTINE bar
+
+END MODULE final_type
+
+PROGRAM finalizer
+ IMPLICIT NONE
+ ! Do nothing here
+END PROGRAM finalizer
+
+! { dg-final { cleanup-modules "final_type" } }