OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [goto_2.f90] - Diff between revs 302 and 384

Only display areas with differences | Details | Blame | View Log

Rev 302 Rev 384
! { dg-do run }
! { dg-do run }
! Checks for corrects warnings if branching to then end of a
! Checks for corrects warnings if branching to then end of a
! construct at various nesting levels
! construct at various nesting levels
  subroutine check_if(i)
  subroutine check_if(i)
    goto 10  ! { dg-warning "Label at ... is not in the same block" }
    goto 10  ! { dg-warning "Label at ... is not in the same block" }
    if (i > 0) goto 40
    if (i > 0) goto 40
    if (i < 0) then
    if (i < 0) then
       goto 40
       goto 40
10  end if    ! { dg-warning "Label at ... is not in the same block" }
10  end if    ! { dg-warning "Label at ... is not in the same block" }
    if (i == 0) then
    if (i == 0) then
       i = i+1
       i = i+1
       goto 20
       goto 20
       goto 40
       goto 40
20  end if
20  end if
    if (i == 1) then
    if (i == 1) then
       i = i+1
       i = i+1
       if (i == 2) then
       if (i == 2) then
          goto 30
          goto 30
       end if
       end if
       goto 40
       goto 40
30  end if
30  end if
    return
    return
40  i = -1
40  i = -1
  end subroutine check_if
  end subroutine check_if
  subroutine check_select(i)
  subroutine check_select(i)
    goto 10  ! { dg-warning "Label at ... is not in the same block" }
    goto 10  ! { dg-warning "Label at ... is not in the same block" }
    select case (i)
    select case (i)
    case default
    case default
       goto 999
       goto 999
10  end select  ! { dg-warning "Label at ... is not in the same block" }
10  end select  ! { dg-warning "Label at ... is not in the same block" }
    select case (i)
    select case (i)
    case (2)
    case (2)
       i = 1
       i = 1
       goto 20
       goto 20
       goto 999
       goto 999
    case default
    case default
       goto 999
       goto 999
20  end select
20  end select
    j = i
    j = i
    select case (j)
    select case (j)
    case default
    case default
       select case (i)
       select case (i)
       case (1)
       case (1)
          i = 2
          i = 2
          goto 30
          goto 30
       end select
       end select
       goto 999
       goto 999
30  end select
30  end select
    return
    return
999 i = -1
999 i = -1
  end subroutine check_select
  end subroutine check_select
  i = 0
  i = 0
  call check_if (i)
  call check_if (i)
  if (i /= 2) call abort ()
  if (i /= 2) call abort ()
  call check_select (i)
  call check_select (i)
  if (i /= 2) call abort ()
  if (i /= 2) call abort ()
end
end
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.