| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-O2 -fdump-tree-optimized" } |
| 3 |
! |
| 4 |
! Check whether the "does_not_exist" subroutine has been |
| 5 |
! optimized away, i.e. check that "foo"'s intent(IN) gets |
| 6 |
! honoured. |
| 7 |
! |
| 8 |
! PR fortran/43665 |
| 9 |
! |
| 10 |
interface |
| 11 |
subroutine foo(x) |
| 12 |
integer, intent(in) :: x |
| 13 |
end subroutine foo |
| 14 |
end interface |
| 15 |
|
| 16 |
integer :: y |
| 17 |
|
| 18 |
y = 5 |
| 19 |
call foo(y) |
| 20 |
if (y /= 5) call does_not_exist () |
| 21 |
end |
| 22 |
|
| 23 |
! { dg-final { scan-tree-dump-times "does_not_exist" 0 "optimized" } } |