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
)) call abort ()
17 if (j
/= 42) call abort ()
20 ! Deferred-length string scalar
22 logical, save :: first
= .true
.
23 character(len
=:), allocatable
:: str
26 if (allocated (str
)) call abort ()
29 if (.not
. allocated (str
)) call abort ()
30 if (len (str
) /= 6) call abort ()
31 if (str(1:6) /= "ABCDEF") call abort ()
34 ! Deferred-length string array
35 subroutine bar_array()
36 logical, save :: first
= .true
.
37 character(len
=:), allocatable
:: str
40 if (allocated (str
)) call abort ()
43 if (.not
. allocated (str
)) call abort ()
44 if (len (str
) /= 6) call abort ()
45 if (str(1:6) /= "ABCDEF") call abort ()
46 end subroutine bar_array