aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr44735.f90
blob: 3ba7bbad0f646a23c7fff2113ce7b1c5cf68a1f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
! { dg-do run }

program main
  if (bug() /= "abcdefghij") STOP 1
contains
  function bug()
    character(len=10) :: bug
    character(len=1), dimension(:), pointer :: p_chars
    allocate(p_chars(10))
    p_chars = ['a','b','c','d','e','f','g','h','i','j']
    forall (i=1:len(bug))
      bug(i:i) = p_chars(i)
    end forall
    deallocate(p_chars)
  end function bug
end program main