summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pure_byref_1.f90
blob: 5e080e5af101c5cf25cecdd527fd2b1172c02f95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
! { dg-do run }
! PR 22607: PURE/ELEMENTAL return-by-reference functions
program main
  implicit none
  character(2), dimension(2) :: a, b
  a = 'ok'
  b = fun(a)
  if (.not.all(b == 'ok')) call abort()
contains
  elemental function fun(a) 
    character(*), intent(in) :: a
    character(len(a)) :: fun
    fun = a
  end function fun
end program main