OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [typebound_call_13.f03] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do run }
2
!
3
! PR 43256: [OOP] TBP with missing optional arg
4
!
5
! Contributed by Janus Weil
6
 
7
module module_myobj
8
 
9
  implicit none
10
 
11
  type :: myobj
12
  contains
13
    procedure, nopass :: myfunc
14
  end type
15
 
16
contains
17
 
18
  integer function myfunc(status)
19
    integer, optional :: status
20
    if (present(status)) then
21
      myfunc = 1
22
    else
23
      myfunc = 2
24
    end if
25
  end function
26
 
27
end module
28
 
29
 
30
program test_optional
31
 
32
  use :: module_myobj
33
  implicit none
34
 
35
  integer     :: res = 0
36
  type(myobj) :: myinstance
37
 
38
  res = myinstance%myfunc()
39
  if (res /= 2) call abort()
40
 
41
end program
42
 
43
! { dg-final { cleanup-modules "module_myobj" } }

powered by: WebSVN 2.1.0

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