gcc/testsuite/gfortran.dg/intent_optimize_3.f90
raw| 1 | ! { dg-do run } |
| 2 | ! { dg-options "-O2" } |
| 3 | ! PR99169 - Segfault passing allocatable scalar into intent(out) dummy argument |
| 4 | |
| 5 | program p |
| 6 | implicit none |
| 7 | integer, allocatable :: i |
| 8 | allocate (i) |
| 9 | call set (i) |
| 10 | if (i /= 5) stop 1 |
| 11 | contains |
| 12 | subroutine set (i) |
| 13 | integer, intent(out) :: i |
| 14 | i = 5 |
| 15 | end subroutine set |
| 16 | end program p |