2 ! { dg-require-effective-target lto }
3 ! { dg-options "-fno-automatic -flto -g" }
7 ! Check that -fno-automatic makes the local variable SAVEd
8 ! Check that -flto -g works
14 integer, allocatable
:: j
16 if (.not
. allocated (j
)) STOP 1
20 ! Deferred-length string scalar
22 logical, save :: first
= .true
.
23 character(len
=:), allocatable
:: str
26 if (allocated (str
)) STOP 3
29 if (.not
. allocated (str
)) STOP 4
30 if (len (str
) /= 6) STOP 5
31 if (str(1:6) /= "ABCDEF") STOP 6
34 ! Deferred-length string array
35 subroutine bar_array()
36 logical, save :: first
= .true
.
37 character(len
=:), allocatable
:: str
40 if (allocated (str
)) STOP 7
43 if (.not
. allocated (str
)) STOP 8
44 if (len (str
) /= 6) STOP 9
45 if (str(1:6) /= "ABCDEF") STOP 10
46 end subroutine bar_array