summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocatable_scalar_8.f90
blob: f7940ede5750210787c9ec7d426e7806b4b11d02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! { dg-do run }
!
! PR fortran/41872
!
! Character functions returning allocatable scalars
!
program test
  implicit none
  if (func () /= 'abc') call abort ()
contains
  function func() result (str)
    character(len=3), allocatable :: str
    if (allocated (str)) call abort ()
    allocate (str)
    str = 'abc'
  end function func
end program test