OSDN Git Service

* config/i386/i386.md (UNSPEC_VSIBADDR): New.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / typebound_call_13.f03
1 ! { 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" } }