PR target/83368
[official-gcc.git] / gcc / testsuite / gfortran.dg / do_check_5.f90
blob57930fd61ad7200d86eeb1b43dd2f176d0020eb1
1 ! { dg-do compile }
2 ! { dg-options "-Wall" }
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
31 end do
32 ! { dg-warning "must be integer" "loop var" { target *-*-* } 30 }
33 ! { dg-error "cannot be zero" "loop step" { target *-*-* } 30 }
34 end