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