gcc/testsuite/gfortran.dg/module_procedure_3.f90
raw| 1 | ! { dg-do run } |
| 2 | ! |
| 3 | ! PR fortran/94348 |
| 4 | ! |
| 5 | ! Contributed by Damian Rouson |
| 6 | |
| 7 | module foo_module |
| 8 | implicit none |
| 9 | |
| 10 | interface |
| 11 | module function foo() result(bar) |
| 12 | implicit none |
| 13 | integer bar |
| 14 | end function |
| 15 | end interface |
| 16 | |
| 17 | contains |
| 18 | module procedure foo |
| 19 | bar = 5 |
| 20 | end procedure |
| 21 | end module |
| 22 | |
| 23 | program main |
| 24 | use foo_module |
| 25 | implicit none |
| 26 | if (foo() /= 5) stop 1 |
| 27 | end program main |