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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [associate_8.f03] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-std=f2003 -fall-intrinsics" }
3
 
4
! PR fortran/38936
5
! Check associate to polymorphic entities.
6
 
7
! Contributed by Tobias Burnus, burnus@gcc.gnu.org.
8
 
9
type t
10
end type t
11
 
12
type, extends(t) :: t2
13
end type t2
14
 
15
class(t), allocatable :: a, b
16
allocate( t :: a)
17
allocate( t2 :: b)
18
 
19
associate ( one => a, two => b)
20
  select type(two)
21
    type is (t)
22
      call abort ()
23
    type is (t2)
24
      print *, 'OK', two
25
    class default
26
      call abort ()
27
  end select
28
  select type(one)
29
    type is (t2)
30
      call abort ()
31
    type is (t)
32
      print *, 'OK', one
33
    class default
34
      call abort ()
35
  end select
36
end associate
37
end

powered by: WebSVN 2.1.0

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