summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/automatic_module_variable.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/automatic_module_variable.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/automatic_module_variable.f9018
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/automatic_module_variable.f90 b/gcc/testsuite/gfortran.dg/automatic_module_variable.f90
new file mode 100644
index 000000000..c88b355b2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/automatic_module_variable.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! Tests fix for PR15976
+!
+module sd
+ integer, parameter :: n = 20
+ integer :: i(n)
+ integer :: j(m) ! { dg-error "must have constant shape" }
+ integer, pointer :: p(:)
+ integer, allocatable :: q(:)
+contains
+ function init (x, l)
+ integer :: x(l)
+ integer :: init(l)
+ init = x
+ end function init
+end module sd
+
+! { dg-final { cleanup-modules "sd" } }