OSDN Git Service

ChangeLogs fixed, again.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / size_optional_dim_1.f90
1 ! { dg-do run }
2 ! PR 30865 - passing a subroutine optional argument to size(dim=...)
3 ! used to segfault.
4 program main
5   implicit none
6   integer :: a(2,3)
7   integer :: ires
8
9   call checkv (ires, a)
10   if (ires /= 6) call abort
11   call checkv (ires, a, 1)
12   if (ires /= 2) call abort
13 contains
14   subroutine checkv(ires,a1,opt1)
15     integer, intent(out) :: ires
16     integer :: a1(:,:)
17     integer, optional :: opt1
18
19     ires = size (a1, dim=opt1)
20   end subroutine checkv
21 end program main