2 ! { dg-options "-fno-automatic" }
6 ! Check that -fno-automatic makes the local variable SAVEd
12 integer, allocatable
:: j
14 if (.not
. allocated (j
)) call abort ()
15 if (j
/= 42) call abort ()
18 ! Deferred-length string scalar
20 logical, save :: first
= .true
.
21 character(len
=:), allocatable
:: str
24 if (allocated (str
)) call abort ()
27 if (.not
. allocated (str
)) call abort ()
28 if (len (str
) /= 6) call abort ()
29 if (str(1:6) /= "ABCDEF") call abort ()
32 ! Deferred-length string array
33 subroutine bar_array()
34 logical, save :: first
= .true
.
35 character(len
=:), allocatable
:: str
38 if (allocated (str
)) call abort ()
41 if (.not
. allocated (str
)) call abort ()
42 if (len (str
) /= 6) call abort ()
43 if (str(1:6) /= "ABCDEF") call abort ()
44 end subroutine bar_array