view gcc/testsuite/gfortran.dg/namelist_args.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 }
! { dg-options -std=gnu }
! PR50555 synonymous namelist/statement function dummy argument not allowed
subroutine g(k1, k2, k3)
  integer, intent(in) :: k1, k2, k3
  print *, k
end subroutine
function j(k1, k2, k3)
  integer, intent(in) :: k1, k2, k3
  j = 25 * k
end function
program pr50555
  namelist /i/ j
  call g(k,l,i) ! { dg-error "cannot be an argument" }
  f(k,l,i)=0    ! { dg-error "cannot be an argument" }
  h = j(k,l,i)  ! { dg-error "cannot be an argument" }
end program
! Note: -std=gnu needed because line 15 function statement is obsolescent