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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [allocate_with_source_1.f90] - Rev 801

Go to most recent revision | Compare with Previous | Blame | View Log

! { dg-do run }
! Test the fix for PR47592, in which the SOURCE expression was
! being called twice.
!
! Contributed by Thomas Koenig  <tkoenig@gcc.gnu.org>
!
module foo
  implicit none
contains
  function bar()
    integer bar
    integer :: i=9
    i = i + 1
    bar = i
  end function bar
end module foo

program note7_35
  use foo
  implicit none
  character(:), allocatable :: name
  character(:), allocatable :: src
  integer n
  n = 10
  allocate(name, SOURCE=repeat('x',bar()))
  if (name .ne. 'xxxxxxxxxx') call abort
  if (len (name) .ne. 10 ) call abort
end program note7_35
! { dg-final { cleanup-modules "foo" } }

Go to most recent revision | 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.