summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/namelist_32.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/namelist_32.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_32.f9017
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/namelist_32.f90 b/gcc/testsuite/gfortran.dg/namelist_32.f90
new file mode 100644
index 000000000..76d514833
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_32.f90
@@ -0,0 +1,17 @@
+! { dg-do compile }
+! One of two tests for the fix of PR23152 - An ICE would
+! ensue from assumed shape arrays in namelists.
+!
+! Conributed by Paul Thomas <pault@gcc.gnu.org>
+!
+program assumed_size_nml
+ real, dimension (10) :: z
+ z = 42.0
+ call foo (z)
+contains
+ subroutine foo (y)
+ real, DIMENSION (*) :: y
+ namelist /mynml/ y ! { dg-error "is not allowed" }
+ write (6, mynml)
+ end subroutine foo
+end program assumed_size_nml \ No newline at end of file