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] - Blame information for rev 749

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! Test the fix for PR47592, in which the SOURCE expression was
3
! being called twice.
4
!
5
! Contributed by Thomas Koenig  
6
!
7
module foo
8
  implicit none
9
contains
10
  function bar()
11
    integer bar
12
    integer :: i=9
13
    i = i + 1
14
    bar = i
15
  end function bar
16
end module foo
17
 
18
program note7_35
19
  use foo
20
  implicit none
21
  character(:), allocatable :: name
22
  character(:), allocatable :: src
23
  integer n
24
  n = 10
25
  allocate(name, SOURCE=repeat('x',bar()))
26
  if (name .ne. 'xxxxxxxxxx') call abort
27
  if (len (name) .ne. 10 ) call abort
28
end program note7_35
29
! { dg-final { cleanup-modules "foo" } }

powered by: WebSVN 2.1.0

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