3 ! Test the fix for PR69423.
5 ! Contributed by Antony Lewis <antony@cosmologist.info>
8 character(LEN
=:), allocatable
:: S
10 if (len(S
) .ne
. 4) STOP 1
11 if (S
.ne
. "test") STOP 2
12 if (allocated (S
)) deallocate (S
)
15 if (len(S
) .ne
. 4) STOP 3
16 if (S
.ne
. "test") STOP 4
17 if (allocated (S
)) deallocate (S
)
20 character(LEN
=:), allocatable
:: test
26 ! This line would print nothing when compiled with -O1 and higher.
27 ! print *, len(test),test
28 if (len(test
) .ne
. 4) STOP 5
29 if (test
.ne
. "test") STOP 6
32 function test2(alen
) result (test
)
33 character(LEN
=:), allocatable
:: test
39 ! This worked before the fix.
40 ! print *, len(test),test
41 if (len(test
) .ne
. 4) STOP 7
42 if (test
.ne
. "test") STOP 8