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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
!
3
! PR fortran/48887
4
!
5
! "If the selector is allocatable, it shall be allocated; the
6
!  associate name is associated with the data object and does
7
!  not have the ALLOCATABLE attribute."
8
!
9
module m
10
  type t
11
  end type t
12
contains
13
  subroutine one(a)
14
    class(t), allocatable :: a
15
    class(t), allocatable :: b
16
    allocate (b)
17
    select type (b)
18
      type is(t)
19
        call move_alloc (b, a) ! { dg-error "must be ALLOCATABLE" }
20
    end select
21
  end subroutine one
22
 
23
  subroutine two (a)
24
    class(t), allocatable :: a
25
    type(t), allocatable :: b
26
    allocate (b)
27
    associate (c => b)
28
      call move_alloc (b, c) ! { dg-error "must be ALLOCATABLE" }
29
    end associate
30
  end subroutine two
31
end module m
32
 
33
type t
34
end type t
35
class(t), allocatable :: x
36
 
37
select type(x)
38
  type is(t)
39
    print *, allocated (x) ! { dg-error "must be ALLOCATABLE" }
40
end select
41
 
42
select type(y=>x)
43
  type is(t)
44
    print *, allocated (y)  ! { dg-error "must be ALLOCATABLE" }
45
end select
46
 
47
associate (y=>x)
48
  print *, allocated (y)  ! { dg-error "must be ALLOCATABLE" }
49
end associate
50
end

powered by: WebSVN 2.1.0

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