summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/coarray_allocate_12.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/coarray_allocate_12.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_allocate_12.f9019
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/coarray_allocate_12.f90 b/gcc/testsuite/gfortran.dg/coarray_allocate_12.f90
new file mode 100644
index 00000000000..2169aa19998
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray_allocate_12.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+!
+! PR fortran/105184
+! Based on testcases by Gerhard Steinmetz
+
+program p
+ real, allocatable :: x[:,:]
+ integer :: n = 2
+ allocate (x[ n, *])
+ allocate (x[1:n, *])
+ allocate (x[n:n, *])
+ allocate (x[n, 5:*])
+ allocate (x[ :n, *]) ! { dg-error "Bad coarray specification" }
+ allocate (x[::n, *]) ! { dg-error "Bad coarray specification" }
+ allocate (x[ :1:1, *]) ! { dg-error "Bad coarray specification" }
+ allocate (x[1:n:n, *]) ! { dg-error "Bad coarray specification" }
+ allocate (x[1, : *]) ! { dg-error "Missing lower bound" }
+end