summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/automatic_module_variable.f90
diff options
context:
space:
mode:
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-11 04:44:16 +0000
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-11 04:44:16 +0000
commit7b7b9e53fb49163f1dcaa512a6bd4973a9fc500d (patch)
tree85d233bc91b50f52d627c1a4ab132a7ed7885909 /gcc/testsuite/gfortran.dg/automatic_module_variable.f90
parent360738f1a5bd169ed4049132a474a1adb716675d (diff)
downloadgcc-7b7b9e53fb49163f1dcaa512a6bd4973a9fc500d.tar.gz
PR fortran/15976
* resolve.c (resolve_symbol): Disallow automatic arrays in module scope. * gfortran.dg/automatic_module_variable.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106777 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/automatic_module_variable.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/automatic_module_variable.f9016
1 files changed, 16 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 00000000000..0cf43f7e853
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/automatic_module_variable.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! Tests fix for PR15976
+!
+module sd
+ integer, parameter :: n = 20
+ integer :: i(n)
+ integer :: j(m) ! { dg-error "cannot be automatic or assumed 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