URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [select_type_6.f03] - Rev 316
Go to most recent revision | Compare with Previous | Blame | View Log
! { dg-do run }
!
! PR 41579: [OOP/Polymorphism] Nesting of SELECT TYPE
!
! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
type t1
end type t1
type, extends(t1) :: t2
integer :: i
end type t2
type, extends(t1) :: t3
integer :: j
end type t3
class(t1), allocatable :: mt2, mt3
allocate(t2 :: mt2)
allocate(t3 :: mt3)
select type (mt2)
type is(t2)
mt2%i = 5
print *,mt2%i
select type(mt3)
type is(t3)
mt3%j = 2*mt2%i
print *,mt3%j
if (mt3%j /= 10) call abort()
class default
call abort()
end select
class default
call abort()
end select
end
Go to most recent revision | Compare with Previous | Blame | View Log