view gcc/testsuite/gfortran.dg/overload_2.f90 @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children 84e7813d76e9
line wrap: on
line source

! { dg-do compile }
! Test the fix for PR32157, in which overloading 'LEN', as
! in 'test' below would cause a compile error.
!
! Contributed by Michael Richmond <michael.a.richmond@nasa.gov>
!
subroutine len(c)
  implicit none
  character :: c
  c = "X"
end subroutine len

subroutine test()
  implicit none
  character :: str
  external len
  call len(str)
  if(str /= "X") call abort()
end subroutine test

PROGRAM VAL
 implicit none
 external test
 intrinsic len
 call test()
 if(len(" ") /= 1) call abort()
END