2016-01-15 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / where_4.f90
blob1ff2e4ca31abe5f347b8f375b5d4239fe1455ac3
1 ! { dg-do compile }
2 ! PR 60522 - this used to ICE.
3 ! Original test case Roger Ferrer Ibanez
4 subroutine foo(a, b)
5 implicit none
6 integer, dimension(:), intent(inout) :: a
7 integer, dimension(:), intent(in) :: b
9 where (b(:) > 0)
10 where (b(:) > 100)
11 a(lbound(a, 1):ubound(a, 1)) = b(lbound(b, 1):ubound(b, 1)) * b(lbound(b, 1):ubound(b, 1)) - 100
12 elsewhere
13 a(lbound(a, 1):ubound(a, 1)) = b(lbound(b, 1):ubound(b, 1)) * b(lbound(b, 1):ubound(b, 1))
14 end where
15 elsewhere
16 a(lbound(a, 1):ubound(a, 1)) = - b(lbound(b, 1):ubound(b, 1)) * b(lbound(b, 1):ubound(b, 1))
17 end where
18 end subroutine foo