fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / finalize_3.f03
blobedc493bfca514e41f0737b56bcad4b00ab58cc8f
1 ! { dg-do compile }
3 ! Parsing of finalizer procedure definitions.
4 ! Check that CONTAINS disallows further components and no double CONTAINS
5 ! is allowed.
7 MODULE final_type
8   IMPLICIT NONE
10   TYPE :: mytype
11     INTEGER, ALLOCATABLE :: fooarr(:)
12     REAL :: foobar
13   CONTAINS
14   CONTAINS ! { dg-error "Already inside a CONTAINS block" }
15     INTEGER :: x ! { dg-error "must precede CONTAINS" }
16   END TYPE mytype
18 END MODULE final_type
20 PROGRAM finalizer
21   IMPLICIT NONE
22   ! Do nothing here
23 END PROGRAM finalizer
25 ! { dg-final { cleanup-modules "final_type" } }