mirror of
https://github.com/autc04/Retro68.git
synced 2024-06-28 11:30:19 +00:00
23 lines
492 B
Fortran
23 lines
492 B
Fortran
! { dg-options "-Wundefined-do-loop" }
|
|
! Program to check corner cases for DO statements.
|
|
|
|
program do_1
|
|
implicit none
|
|
integer i, j
|
|
|
|
! limit=HUGE(i), step 1
|
|
j = 0
|
|
do i = HUGE(i) - 10, HUGE(i), 1 ! { dg-warning "is undefined as it overflows" }
|
|
j = j + 1
|
|
end do
|
|
if (j .ne. 11) STOP 1
|
|
|
|
! limit=-HUGE(i)-1, step -1
|
|
j = 0
|
|
do i = -HUGE(i) + 10 - 1, -HUGE(i) - 1, -1 ! { dg-warning "is undefined as it underflows" }
|
|
j = j + 1
|
|
end do
|
|
if (j .ne. 11) STOP 2
|
|
|
|
end program
|