OSDN Git Service

2009-10-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / forall_11.f90
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
9
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
13
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
17
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
23
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
27
28 forall (i=1:10)
29    forall (j=i:10)
30       a(i,j) = i*j
31    end forall
32 end forall
33 END