gcc/testsuite/gfortran.dg/pr52370.f90
raw| 1 | ! PR fortran/52370 |
| 2 | ! { dg-do compile } |
| 3 | ! { dg-options "-O1 -Wall" } |
| 4 | |
| 5 | module pr52370 |
| 6 | contains |
| 7 | subroutine foo(a,b) |
| 8 | real, intent(out) :: a |
| 9 | real, dimension(:), optional, intent(out) :: b |
| 10 | a=0.5 |
| 11 | if (present(b)) then |
| 12 | b=1.0 |
| 13 | end if |
| 14 | end subroutine foo |
| 15 | end module pr52370 |
| 16 | |
| 17 | program prg52370 |
| 18 | use pr52370 |
| 19 | real :: a |
| 20 | call foo(a) |
| 21 | end program prg52370 |