summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/zero_sized_3.f90
blob: e4e1c06d2c0d39f1c3eec08d0daf77c06d1149b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do run }
! Testcase for PR libfortran/31001
  implicit none

  integer :: i, j, k
  integer, allocatable :: mm(:)
  logical, allocatable :: mask(:)

  do i = 2, -2, -1
    do k = 0, 1
      allocate (mm(i), mask(i))
      mm(:) = k
      mask(:) = (mm == 0)
      j = count (mask)
      print *, pack (mm, mask)
      if (size (pack (mm, mask)) /= j) call abort
      deallocate (mm, mask)
    end do
  end do
end