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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [dependency_39.f90] - Blame information for rev 774

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! PR 45777 - component ref aliases when both are pointers
3
module m1
4
  type t1
5
     integer, dimension(:), allocatable :: data
6
  end type t1
7
contains
8
  subroutine s1(t,d)
9
    integer, dimension(:), pointer :: d
10
    type(t1), pointer :: t
11
    d(1:5)=t%data(3:7)
12
  end subroutine s1
13
  subroutine s2(d,t)
14
    integer, dimension(:), pointer :: d
15
    type(t1), pointer :: t
16
    t%data(3:7) = d(1:5)
17
  end subroutine s2
18
end module m1
19
 
20
program main
21
  use m1
22
  type(t1), pointer :: t
23
  integer, dimension(:), pointer :: d
24
  allocate(t)
25
  allocate(t%data(10))
26
  t%data=(/(i,i=1,10)/)
27
  d=>t%data(5:9)
28
  call s1(t,d)
29
  if (any(d.ne.(/3,4,5,6,7/))) call abort()
30
  t%data=(/(i,i=1,10)/)
31
  d=>t%data(1:5)
32
  call s2(d,t)
33
  if (any(t%data.ne.(/1,2,1,2,3,4,5,8,9,10/))) call abort
34
  deallocate(t%data)
35
  deallocate(t)
36
end program main
37
! { dg-final { cleanup-modules "m1" } }

powered by: WebSVN 2.1.0

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