goto_2.f90
来自「用于进行gcc测试」· F90 代码 · 共 60 行
F90
60 行
! { dg-do run }! Checks for corrects warnings if branching to then end of a! construct at various nesting levels subroutine check_if(i) goto 10 if (i > 0) goto 40 if (i < 0) then goto 4010 end if if (i == 0) then i = i+1 goto 20 ! { dg-warning "jumps to END of construct" } goto 4020 end if ! { dg-warning "jumps to END of construct" } if (i == 1) then i = i+1 if (i == 2) then goto 30 ! { dg-warning "jumps to END of construct" } end if goto 4030 end if ! { dg-warning "jumps to END of construct" } return40 i = -1 end subroutine check_if subroutine check_select(i) goto 10 select case (i) case default goto 99910 end select select case (i) case (2) i = 1 goto 20 ! { dg-warning "jumps to END of construct" } goto 999 case default goto 99920 end select ! { dg-warning "jumps to END of construct" } j = i select case (j) case default select case (i) case (1) i = 2 goto 30 ! { dg-warning "jumps to END of construct" } end select goto 99930 end select ! { dg-warning "jumps to END of construct" } return 999 i = -1 end subroutine check_select i = 0 call check_if (i) if (i /= 2) call abort () call check_select (i) if (i /= 2) call abort ()end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?