view gcc/testsuite/gfortran.dg/deferred_type_param_4.f90 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { dg-do run }
!
! PR fortran/51055
! PR fortran/49110
!
!
program test
  implicit none
  character(len=:), allocatable :: str
  integer :: i
  i = 5
  str = f()
  call printIt ()
  i = 7
  str = repeat('X', i)
  call printIt ()
contains
  function f()
    character(len=i) :: f
    f = '1234567890'
  end function f
  subroutine printIt
!    print *, len(str)
!    print '(3a)', '>',str,'<'
    if (i == 5) then
      if (str /= "12345" .or. len(str) /= 5) STOP 1
    else if (i == 7) then
      if (str /= "XXXXXXX" .or. len(str) /= 7) STOP 2
    else
      STOP 3
    end if
  end subroutine
end