OpenCores
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/] [impure_assignment_3.f90] - Blame information for rev 302

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do compile }
2
!
3
! PR 43169: [OOP] gfortran rejects PURE procedure with SELECT TYPE construct
4
!
5
! Original test case by Todd Hay 
6
! Modified by Janus Weil 
7
 
8
  implicit none
9
  real :: g
10
 
11
contains
12
 
13
  pure subroutine sub1(x)
14
    type :: myType
15
      real :: a
16
    end type myType
17
    class(myType), intent(inout) :: x
18
    real :: r3
19
    select type(x)
20
    class is (myType)
21
      x%a = 42.
22
      r3 =  43.
23
      g = 44.             ! { dg-error "Cannot assign to variable" }
24
    end select
25
  end subroutine
26
 
27
  pure subroutine sub2
28
    real :: r1
29
    block
30
      real :: r2
31
      r1 = 45.
32
      r2 = 46.
33
      g = 47.             ! { dg-error "Cannot assign to variable" }
34
    end block
35
  end subroutine
36
 
37
  pure subroutine sub3
38
    block
39
      integer, save :: i  ! { dg-error "cannot be specified in a PURE procedure" }
40
      integer :: j = 5    ! { dg-error "is not allowed in a PURE procedure" }
41
    end block
42
  end subroutine
43
 
44
end

powered by: WebSVN 2.1.0

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