Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/do_check_7.f90 @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
! { dg-do compile } ! PR 30146 - warn about DO variables as argument to INTENT(IN) and ! INTENT(INOUT) dummy arguments program main implicit none integer :: i,j, k, l do k=1,2 ! { dg-error "undefined value" } do i=1,10 ! { dg-error "definable" } do j=1,10 ! { dg-error "undefined value" } do l=1,10 ! { dg-error "definable" } call s_out(k) ! { dg-error "undefined" } call s_inout(i) ! { dg-error "definable" } print *,f_out(j) ! { dg-error "undefined" } print *,f_inout(l) ! { dg-error "definable" } end do end do end do end do contains subroutine s_out(i_arg) integer, intent(out) :: i_arg end subroutine s_out subroutine s_inout(i_arg) integer, intent(inout) :: i_arg end subroutine s_inout function f_out(i_arg) integer, intent(out) :: i_arg integer :: f_out f_out = i_arg end function f_out function f_inout(i_arg) integer, intent(inout) :: i_arg integer :: f_inout f_inout = i_arg end function f_inout end program main