| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-O -fno-inline -fdump-tree-optimized -fdump-tree-original" } |
| 3 |
! PR fortran/41453 |
| 4 |
! Check that there is one clobber in the *.original tree, plus that |
| 5 |
! the constant 123456789 has been removed due to the INTENT(OUT). |
| 6 |
|
| 7 |
module x |
| 8 |
implicit none |
| 9 |
contains |
| 10 |
subroutine foo(a) |
| 11 |
integer, intent(out) :: a |
| 12 |
a = 42 |
| 13 |
end subroutine foo |
| 14 |
end module x |
| 15 |
|
| 16 |
program main |
| 17 |
use x |
| 18 |
implicit none |
| 19 |
integer :: a |
| 20 |
a = 123456789 |
| 21 |
call foo(a) |
| 22 |
print *,a |
| 23 |
end program main |
| 24 |
|
| 25 |
! { dg-final { scan-tree-dump-times "123456789" 0 "optimized" } } |
| 26 |
! { dg-final { scan-tree-dump-times "CLOBBER" 1 "original" } } |