regression test for named control statements

Bernhard Fischer rep.nop@aon.at
Wed Aug 24 06:04:00 GMT 2005


Hi,

I did not see a regression test for named control statements in the
testsuite.

Would be something like the attached be appropriate?

thank you,
Bernhard
-------------- next part --------------
! Program to test named control statements
module mod0
  integer imod0
contains
  subroutine my_named_do
    spin: do i=1,5
      conv: do j=1,5
        band: do k=1,5
             if (j.eq.3) cycle conv
        end do band
      end do conv
    end do spin
    imod0 = i*j*k + 40 ! 256
  end subroutine my_named_do
  subroutine my_named_if
19  spin: if (imod0.eq.0) then
      imod0 = 1
    else spin
      imod0 = 256
      return
    end if spin
    go to 19
  end subroutine my_named_if
  subroutine my_named_case
26  spin: select case (imod0)
    case (101:)
      imod0 = 1
    case (:99) spin
      imod0= 100
    case default
      imod0=256
      return
    end select spin
    go to 26
  end subroutine my_named_case
end module mod0

program prog
  use mod0
  call my_named_do
  if (imod0.ne.256) call abort ()
  call my_named_if
  if (imod0.ne.256) call abort ()
  call my_named_case
  if (imod0.ne.256) call abort ()
end program prog


More information about the Fortran mailing list