view gcc/testsuite/gfortran.dg/allocatable_scalar_8.f90 @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children 84e7813d76e9
line wrap: on
line source

! { 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