PR rtl-optimization/82913
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / where_8.f90
blob58a26bd348387913711b52bb7300400a7a79e9a2
1 program where_8
2 implicit none
3 type t
4 logical valid
5 integer :: s
6 integer, dimension(8) :: p
7 end type
8 type (t), dimension (5) :: v
9 integer i
11 v(:)%valid = (/.true., .true., .false., .true., .true./)
12 v(:)%s = (/1, 8, 999, 6, 2/)
13 v(1)%p(:) = (/9, 10, 0, 0, 0, 0, 0, 0/)
14 v(2)%p(:) = (/1, 2, 3, 4, 5, 6, 7, 8/)
15 v(4)%p(:) = (/13, 14, 15, 16, 17, 18, 19, 20/)
16 v(5)%p(:) = (/11, 12, 0, 0, 0, 0, 0, 0/)
18 forall (i=1:5,v(i)%valid)
19 where (v(i)%p(1:v(i)%s).gt.4)
20 v(i)%p(1:v(i)%s) = 21
21 end where
22 end forall
24 if (any(v(1)%p(:) .ne. (/21, 10, 0, 0, 0, 0, 0, 0/))) call abort
25 if (any(v(2)%p(:) .ne. (/1, 2, 3, 4, 21, 21, 21, 21/))) call abort
26 if (any(v(4)%p(:) .ne. (/21, 21, 21, 21, 21, 21, 19, 20/))) call abort
27 if (any(v(5)%p(:) .ne. (/21, 21, 0, 0, 0, 0, 0, 0/))) call abort
28 end program