]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/gfortran.dg/forall_1.f90
e425c4cd4119a625e895951e067f3e8c019208dc
[gcc.git] / gcc / testsuite / gfortran.dg / forall_1.f90
1 ! { dg-do run { xfail *-*-* } }
2 ! tests FORALL statements with a mask
3 ! unfortunately, this is broken, PR 22038
4 dimension i2(15,10), i1(15)
5 type a
6 sequence
7 integer k
8 end type a
9 type(a) :: a1(10), a2(5,5)
10
11 i1 = (/ 0, 1, 2, 3, 4, 0, 6, 7, 8, 9, 10, 0, 0, 13, 14 /)
12 forall (i=1:15, i1(i) /= 0)
13 i1(i) = 0
14 end forall
15 if (any(i1 /= 0)) call abort
16
17 a1(:)%k = i1(1:10)
18 forall (i=1:10, a1(i)%k == 0)
19 a1(i)%k = i
20 end forall
21 if (any (a1(:)%k /= (/ (i, i=1,10) /))) call abort
22
23 forall (i=1:15, j=1:10, a1(j)%k <= j)
24 i2(i,j) = j + i*11
25 end forall
26 do i=1,15
27 if (any (i2(i,:) /= (/ (i*11 + j, j=1,10) /))) call abort
28 end do
29 end
This page took 0.038103 seconds and 4 git commands to generate.