fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / do_check_5.f90
blob081a228cfc783cb114fc7f1b9665c538d579e5ee
1 ! { dg-do compile }
2 !
3 ! PR/fortran 38432
4 ! DO-loop compile-time checks
6 implicit none
7 integer :: i
8 real :: r
9 do i = 1, 0 ! { dg-warning "executed zero times" }
10 end do
12 do i = 1, -1, 1 ! { dg-warning "executed zero times" }
13 end do
15 do i = 1, 2, -1 ! { dg-warning "executed zero times" }
16 end do
18 do i = 1, 2, 0 ! { dg-error "cannot be zero" }
19 end do
21 do r = 1, 0 ! { dg-warning "must be integer|executed zero times" }
22 end do
24 do r = 1, -1, 1 ! { dg-warning "must be integer|executed zero times" }
25 end do
27 do r = 1, 2, -1 ! { dg-warning "must be integer|executed zero times" }
28 end do
30 do r = 1, 2, 0 ! { dg-error "must be integer|cannot be zero" }
31 end do
32 end