coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr57910.f90
blobc3666a6fcd8978f7d2bf93366c6f0965c32ba855
1 ! { dg-do run }
2 program strtest
4 implicit none
6 character(len=:), allocatable:: my_str
8 integer, parameter :: slen_init = 7
9 integer :: slen = slen_init
11 my_str = fstr(slen)
12 if (slen /= slen_init .or. len(my_str) /= slen .or. my_str /= ' ') then
13 call abort
14 endif
16 contains
18 function fstr(strlen)
19 integer, value :: strlen
20 character(len=strlen)::fstr
22 strlen = 17 ! Make sure strlen was really passed by value
23 fstr = ' '
24 end function fstr
26 end program strtest