Debian Codegraph @

gcc/testsuite/gfortran.dg/finalize_3.f03

raw
1 ! { dg-do compile }
2
3 ! Parsing of finalizer procedure definitions.
4 ! Check that CONTAINS disallows further components and no double CONTAINS
5 ! is allowed.
6
7 MODULE final_type
8 IMPLICIT NONE
9
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
17
18 END MODULE final_type
19
20 PROGRAM finalizer
21 IMPLICIT NONE
22 ! Do nothing here
23 END PROGRAM finalizer