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