Debian Codegraph @

gcc/testsuite/gfortran.dg/iall_masked.f90

raw
1 ! { dg-do run }
2 ! PR fortran/96890 - Wrong answer with intrinsic IALL
3 program p
4 implicit none
5 integer :: iarr1(0), iarr2(2,2), iarr3(2,2,2)
6 logical :: mask1(0), mask2(2,2), mask3(2,2,2)
7
8 if ( iall(iarr1, mask1) /= -1 ) stop 1
9 if ( iall(iarr1, 1, mask1) /= -1 ) stop 2
10
11 iarr2 = reshape ([ 1, 2, 3, 4 ], shape (iarr2))
12 mask2 = reshape ([ .true., .false., .true., .false. ], shape (mask2))
13
14 if (any (iall(iarr2, 2, mask2) /= [1,-1]) ) stop 3
15
16 iarr3 = reshape ([ 1, 2, 3, 4, &
17 5, 6, 7, 8 ], shape (iarr3))
18 mask3 = reshape ([ .true., .false., .true., .false.,&
19 .true., .false., .true., .false. ], shape (iarr3))
20
21 if (any (iall(iarr3, 2, mask3) /= reshape ([1,-1,5,-1],[2,2]))) stop 4
22 end