OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [allocate_deferred_char_scalar_2.f03] - Rev 694

Compare with Previous | Blame | View Log

! { dg-do run }
! Test the fix for PR47519, in which the character length was not
! calculated for the SOURCE expressions below and an ICE resulted. 
!
! Contributed by Tobias Burnus  <burnus@gcc.gnu.org>
!
program note7_35
   implicit none
   character(:), allocatable :: name
   character(:), allocatable :: src
   integer n
   n = 10
   allocate(name, SOURCE=repeat('x',n))
   if (name .ne. 'xxxxxxxxxx') call abort
   if (len (name) .ne. 10 ) call abort
   deallocate(name)
   src = 'xyxy'
   allocate(name, SOURCE=repeat(src,n))
   if (name(37:40) .ne. 'xyxy') call abort
   if (len (name) .ne. 40 ) call abort
end program note7_35

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.