summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/realloc_on_assign_13.f90
blob: 9661d724f5b6e3b41b76e07be6bdbc3c86ac59cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do compile }
! Test the fix for PR52386.
!
! Contributed by Juergen Reuter  <reuter@physik.uni-freiburg.de>
!
module cascades
  implicit none
  private
contains
    function reduced (array)
      integer, dimension(:), allocatable :: reduced
      integer, dimension(:), intent(in) :: array
      logical, dimension(size(array)) :: mask
      mask = .true. 
      allocate (reduced (count (mask)))
      reduced = pack (array, mask)
    end function reduced
end module cascades
! { dg-final { cleanup-modules "cascades" } }