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

Subversion Repositories openrisc

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

Compare with Previous | Blame | View Log

! { dg-do run }
! { dg-options "-fno-inline" }
!
! PR fortran/46937
!
! Check that a non-pointer INTENT(IN) dummy
! with pointer component is properly treated
!
program test
 type myT
   integer, pointer :: point
 end type myT
 type(myT) :: t2
 allocate(t2%point)
 t2%point = 42
 call nonpointer(t2)
 if(t2%point /= 7) call abort()
 t2%point = 42
 call nonpointer2(t2)
 if(t2%point /= 66) call abort()
contains
  subroutine nonpointer(t)
     type(myT), intent(in) :: t
     t%point = 7
  end subroutine nonpointer
  subroutine nonpointer2(t)
     class(myT), intent(in) :: t
     t%point = 66
  end subroutine nonpointer2
end program

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.