2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocatable_scalar_8.f90
blobf7940ede5750210787c9ec7d426e7806b4b11d02
1 ! { dg-do run }
3 ! PR fortran/41872
5 ! Character functions returning allocatable scalars
7 program test
8 implicit none
9 if (func () /= 'abc') call abort ()
10 contains
11 function func() result (str)
12 character(len=3), allocatable :: str
13 if (allocated (str)) call abort ()
14 allocate (str)
15 str = 'abc'
16 end function func
17 end program test