2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray_18.f90
blob474e9391edb19a02238037c1086ba2bf94724cb2
1 ! { dg-do compile }
2 ! { dg-options "-fcoarray=single" }
4 ! Prevent ICE when exceeding the maximal number of allowed
5 ! dimensions (normal + codimensions).
7 ! Fortran 2008 allows (co)arrays with 15 ranks
8 ! Currently, gfortran only supports 7, cf. PR 37577
9 ! Thus, the program is valid Fortran 2008 ...
11 ! See also general coarray PR 18918
13 ! Test case taken from Leibniz-Rechenzentrum (LRZ)'s
14 ! fortran_tests with thanks to Reinhold Bader.
17 program ar
18 implicit none
19 integer :: ic(2)[*]
20 integer :: id(2,2)[2,*]
21 integer :: ie(2,2,2)[2,2,*]
22 integer :: ig(2,2,2,2)[2,2,2,*] ! { dg-error "has more than 7 dimensions" }
23 integer :: ih(2,2,2,2,2)[2,2,2,2,*] ! { dg-error "has more than 7 dimensions" }
24 integer :: ij(2,2,2,2,2,2)[2,2,2,2,2,*] ! { dg-error "has more than 7 dimensions" }
25 integer :: ik(2,2,2,2,2,2,2)[2,2,2,2,2,2,*] ! { dg-error "has more than 7 dimensions" }
26 integer :: il[2,2,2,2,2,2,2,*] ! { dg-error "has more than 7 dimensions" }
27 integer :: im[2,2,2,2,2,2,2,2,*] ! { dg-error "has more than 7 dimensions" }
28 integer :: in[2,2,2,2,2,2,2,2,2,*] ! { dg-error "has more than 7 dimensions" }
29 integer :: io[2,2,2,2,2,2,2,2,2,2,*] ! { dg-error "has more than 7 dimensions" }
30 real :: x2(2,2,4)[2,*]
31 complex :: c2(4,2)[2,*]
32 double precision :: d2(1,5,9)[2,*]
33 character(len=1) :: ch2(2)[2,*]
34 character(len=2) :: ch22(-5:4)[2,*]
35 logical :: l2(17)[2,*]
36 if (this_image() == 1) then
37 write(*,*) 'OK'
38 end if
39 end program