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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [char_pointer_dependency.f90] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! Test assignments from character pointer functions with dependencies
3
! are correctly resolved.
4
! Provided by Paul Thomas pault@gcc.gnu.org
5
program char_pointer_dependency
6
  implicit none
7
  character*4, pointer       :: c2(:)
8
  allocate (c2(2))
9
  c2 = (/"abcd","efgh"/)
10
  c2 = afoo (c2)
11
  if (c2(1) /= "efgh") call abort ()
12
  if (c2(2) /= "abcd") call abort ()
13
  deallocate (c2)
14
contains
15
  function afoo (ac0) result (ac1)
16
    integer                    :: j
17
    character*4                :: ac0(:)
18
    character*4, pointer       :: ac1(:)
19
    allocate (ac1(2))
20
    do j = 1,2
21
      ac1(j) = ac0(3-j)
22
    end do
23
  end function afoo
24
end program char_pointer_dependency

powered by: WebSVN 2.1.0

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