[to-be-committed] [RISC-V] Use Zbkb for general 64 bit constants when profitable
[official-gcc.git] / gcc / testsuite / gfortran.dg / typebound_call_13.f03
blobe95a268dcd977178b3b2f29a3ece16f65311ba7c
1 ! { dg-do run }
3 ! PR 43256: [OOP] TBP with missing optional arg
5 ! Contributed by Janus Weil
7 module module_myobj
9   implicit none
11   type :: myobj
12   contains
13     procedure, nopass :: myfunc
14   end type
16 contains
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
27 end module
30 program test_optional
32   use :: module_myobj
33   implicit none
35   integer     :: res = 0
36   type(myobj) :: myinstance
38   res = myinstance%myfunc()
39   if (res /= 2) STOP 1
41 end program