aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/pr16861.f90
blob: 4a73edaf4f0345aa5ec2eb2c1251b73417ffa664 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
! PR fortran/16861
! { dg-do run }
module foo
  integer :: i
end module foo

module bar
contains
  subroutine baz(j)
    use foo
    integer, dimension(i) :: j
    integer :: n

    do n = 1, i
      if (j(n) /= n**2) call abort
    end do
  end subroutine baz
end module bar

subroutine quus()
  use foo
  use bar

  i = 2
  call baz ((/1,4/))
  i = 7
  call baz ((/1,4,9,16,25,36,49/))
end subroutine quus

program test
  call quus
end program test