2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / forall_11.f90
blob4c556951c7e1f04b9e9717696cc7e3550fa95500
1 ! { dg-do compile }
2 ! PR 25076
3 ! We erroneously accepted it when a FORALL index was used in a triplet
4 ! specification within the same FORALL header
5 INTEGER :: A(10,10)
6 FORALL(I=1:10,J=I:10) ! { dg-error "FORALL index 'i' may not appear in triplet specification" }
7 A(I,J)=I+J
8 ENDFORALL
10 forall (i=1:10, j=1:i) ! { dg-error "FORALL index 'i' may not appear in triplet specification" }
11 a(i,j) = 5
12 end forall
14 forall (i=1:10, j=1:10:i) ! { dg-error "FORALL index 'i' may not appear in triplet specification" }
15 a(i,j) = i - j
16 end forall
18 forall (i=i:10) ! { dg-error "FORALL index 'i' may not appear in triplet specification" }
19 forall (j=1:j:i) ! { dg-error "FORALL index 'j' may not appear in triplet specification" }
20 a(i,j) = i*j
21 end forall
22 end forall
24 forall (i=1:10:i) ! { dg-error "FORALL index 'i' may not appear in triplet specification" }
25 a(1,i) = 2
26 end forall
28 forall (i=1:10)
29 forall (j=i:10)
30 a(i,j) = i*j
31 end forall
32 end forall
33 END