PR rtl-optimization/82913
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / where19.f90
blob3c41b89978cd389ea1db3dee65c3ba98162bbb95
1 ! Check to ensure result is calculated from unmodified
2 ! version of the right-hand-side in WHERE statements.
3 program where_19
4 integer :: a(4)
5 integer :: b(3)
6 integer :: c(3)
7 equivalence (a(1), b(1)), (a(2), c(1))
9 a = (/1, 2, 3, 4/)
10 where (b .gt. 1)
11 c = b
12 endwhere
13 if (any (a .ne. (/1, 2, 2, 3/))) &
14 call abort ()
16 a = (/1, 2, 3, 4/)
17 where (c .gt. 1)
18 b = c
19 endwhere
20 if (any (a .ne. (/2, 3, 4, 4/))) &
21 call abort ()
22 end program