| 1 |
! { dg-do compile } |
| 2 |
! { dg-additional-options "-fdump-tree-original -fcoarray=lib" } |
| 3 |
! |
| 4 |
! Check that we don't take twice the address of procedure simple_reduction |
| 5 |
! in the generated code. |
| 6 |
! |
| 7 |
! Contributed by Alessandro Fanfarillo <[email protected]> |
| 8 |
|
| 9 |
program simple_reduce |
| 10 |
implicit none |
| 11 |
|
| 12 |
integer :: me |
| 13 |
|
| 14 |
me = this_image() |
| 15 |
|
| 16 |
sync all |
| 17 |
|
| 18 |
call co_reduce(me,simple_reduction) |
| 19 |
|
| 20 |
write(*,*) this_image(),me |
| 21 |
|
| 22 |
contains |
| 23 |
|
| 24 |
pure function simple_reduction(a,b) |
| 25 |
integer,intent(in) :: a,b |
| 26 |
integer :: simple_reduction |
| 27 |
|
| 28 |
simple_reduction = a * b |
| 29 |
end function simple_reduction |
| 30 |
|
| 31 |
end program simple_reduce |
| 32 |
|
| 33 |
! { dg-final { scan-tree-dump "_gfortran_caf_co_reduce \\(&desc\\.\\d+,\\s*simple_reduction," "original" } } |