3 real, dimension(3) :: a
5 do i
=-1,3,2 ! { dg-warning "out of bounds" }
6 a(i
) = 0 ! { dg-warning "out of bounds \\(-1 < 1\\)" }
8 do i
=4,1,-1 ! { dg-warning "out of bounds" }
9 a(i
) = 22 ! { dg-warning "out of bounds \\(4 > 3\\)" }
11 do i
=1,4 ! { dg-warning "out of bounds" }
12 a(i
) = 32 ! { dg-warning "out of bounds \\(4 > 3\\)" }
14 do i
=3,0,-1 ! { dg-warning "out of bounds" }
15 a(i
) = 12 ! { dg-warning "out of bounds \\(0 < 1\\)" }
18 if (i
>0) a(i
) = a(i
) + 1 ! No warning inside if
23 a(i
) = -234 ! No warning inside select case
26 do i
=1,3 ! { dg-warning "out of bounds" }
27 a(i
+1) = a(i
) ! { dg-warning "out of bounds \\(4 > 3\\)" }
28 a(i
-1) = a(i
) ! { dg-warning "out of bounds \\(0 < 1\\)" }
30 do i
=3,1,-1 ! { dg-warning "out of bounds" }
31 a(i
) = a(i
-1) ! { dg-warning "out of bounds \\(0 < 1\\)" }
32 a(i
) = a(i
+1) ! { dg-warning "out of bounds \\(4 > 3\\)" }
34 do i
=1,2 ! { dg-warning "out of bounds" }
35 a(i
) = a(i
*i
) ! { dg-warning "out of bounds \\(4 > 3\\)" }
38 a(i
) = a(i
)*2 ! No error
44 do i
=0,3 ! { dg-warning "out of bounds \\(0 < 1\\)" }
45 a(i
) = 13. ! { dg-warning "out of bounds \\(0 < 1\\)" }
52 do i
=0,3 ! { dg-warning "out of bounds \\(0 < 1\\)" }
54 a(i
) = -123 ! { dg-warning "out of bounds \\(0 < 1\\)" }