2011-02-15 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / do_check_5.f90
blob3df7b14f0ebfd604411a5e8c02960acb3fd678ae
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
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