summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr16861.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pr16861.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/pr16861.f9034
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr16861.f90 b/gcc/testsuite/gfortran.dg/pr16861.f90
new file mode 100644
index 000000000..88f89fa78
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr16861.f90
@@ -0,0 +1,34 @@
+! 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
+
+! { dg-final { cleanup-modules "foo bar" } }