OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [extends_type_of_1.f03] - Diff between revs 302 and 384

Only display areas with differences | Details | Blame | View Log

Rev 302 Rev 384
! { dg-do run }
! { dg-do run }
!
!
! Verifying the runtime behavior of the intrinsic function EXTENDS_TYPE_OF.
! Verifying the runtime behavior of the intrinsic function EXTENDS_TYPE_OF.
!
!
! Contributed by Janus Weil 
! Contributed by Janus Weil 
 implicit none
 implicit none
 intrinsic :: extends_type_of
 intrinsic :: extends_type_of
 type :: t1
 type :: t1
   integer :: i = 42
   integer :: i = 42
 end type
 end type
 type, extends(t1) :: t2
 type, extends(t1) :: t2
   integer :: j = 43
   integer :: j = 43
 end type
 end type
 type, extends(t2) :: t3
 type, extends(t2) :: t3
   class(t1),pointer :: cc
   class(t1),pointer :: cc
 end type
 end type
 class(t1), pointer :: c1,c2
 class(t1), pointer :: c1,c2
 type(t1), target :: x
 type(t1), target :: x
 type(t2), target :: y
 type(t2), target :: y
 type(t3), target :: z
 type(t3), target :: z
 c1 => x
 c1 => x
 c2 => y
 c2 => y
 z%cc => y
 z%cc => y
 if (.not. extends_type_of (c1, c1)) call abort()
 if (.not. extends_type_of (c1, c1)) call abort()
 if (      extends_type_of (c1, c2)) call abort()
 if (      extends_type_of (c1, c2)) call abort()
 if (.not. extends_type_of (c2, c1)) call abort()
 if (.not. extends_type_of (c2, c1)) call abort()
 if (.not. extends_type_of (x, x)) call abort()
 if (.not. extends_type_of (x, x)) call abort()
 if (      extends_type_of (x, y)) call abort()
 if (      extends_type_of (x, y)) call abort()
 if (.not. extends_type_of (y, x)) call abort()
 if (.not. extends_type_of (y, x)) call abort()
 if (.not. extends_type_of (c1, x)) call abort()
 if (.not. extends_type_of (c1, x)) call abort()
 if (      extends_type_of (c1, y)) call abort()
 if (      extends_type_of (c1, y)) call abort()
 if (.not. extends_type_of (x, c1)) call abort()
 if (.not. extends_type_of (x, c1)) call abort()
 if (.not. extends_type_of (y, c1)) call abort()
 if (.not. extends_type_of (y, c1)) call abort()
 if (.not. extends_type_of (z,   c1)) call abort()
 if (.not. extends_type_of (z,   c1)) call abort()
 if (      extends_type_of (z%cc, z)) call abort()
 if (      extends_type_of (z%cc, z)) call abort()
end
end
 
 

powered by: WebSVN 2.1.0

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