2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr70754.f90
blobd7e790cc036dd182098e47dbca53d95f16646feb
1 ! { dg-do compile }
2 ! { dg-options "-Ofast" }
3 module m
4 implicit none
5 private
6 save
8 integer, parameter, public :: &
9 ii4 = selected_int_kind(6), &
10 rr8 = selected_real_kind(13)
12 integer (ii4), dimension(40,40,199), public :: xyz
13 public :: foo
14 contains
15 subroutine foo(a)
16 real (rr8), dimension(40,40), intent(out) :: a
17 real (rr8), dimension(40,40) :: b
18 integer (ii4), dimension(40,40) :: c
19 integer i, j
21 do i=1,20
22 b(i,j) = 123 * a(i,j) + 34 * a(i,j+1) &
23 + 34 * a(i,j-1) + a(i+1,j+1) &
24 + a(i+1,j-1) + a(i-1,j+1) &
25 + a(i-1,j-1)
26 c(i,j) = 123
27 end do
29 where ((xyz(:,:,2) /= 0) .and. (c /= 0))
30 a = b/real(c)
31 elsewhere
32 a = 456
33 endwhere
34 end subroutine foo
35 end module m