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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! PR42008 Wrongly rejected derived types with default initializers
3
! in PURE procedures
4
module mod_xyz
5
 implicit none
6
contains
7
 pure subroutine psub()
8
  type ilist
9
    type(ilist), pointer :: next => null() ! Valid
10
    integer :: i
11
  end type ilist
12
 end subroutine psub
13
end module mod_xyz
14
 
15
module mod_xyz2
16
 implicit none
17
contains
18
 pure subroutine psub()
19
  type ilist
20
    type(ilist), pointer :: next
21
    integer, pointer :: p => null() ! Valid
22
    integer :: i
23
  end type ilist
24
  type(ilist) :: var ! Valid
25
  var%next => null()
26
 end subroutine psub
27
end module mod_xyz2
28
 
29
module mod_xyz3
30
 implicit none
31
 type ilist
32
   type(ilist), pointer :: next => null() ! Valid
33
   integer :: i
34
 end type ilist
35
contains
36
 pure subroutine psub()
37
  type(ilist) :: var ! Valid
38
 end subroutine psub
39
end module mod_xyz3
40
 
41
pure function test()
42
  integer,pointer :: p => null() !{ dg-error "not allowed in a PURE procedure" }
43
  integer :: test
44
  test = p
45
end function test
46
! { dg-final { cleanup-modules "mod_xyz mod_xyz2 mod_xyz3" } }

powered by: WebSVN 2.1.0

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