2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / co_reduce_1.f90
blob1d3e89f65cce374c4ef3229d175a4b1b54ec1f2e
1 ! { dg-do compile }
2 ! { dg-additional-options "-fdump-tree-original -fcoarray=lib" }
4 ! Check that we don't take twice the address of procedure simple_reduction
5 ! in the generated code.
7 ! Contributed by Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
9 program simple_reduce
10 implicit none
12 integer :: me
14 me = this_image()
16 sync all
18 call co_reduce(me,simple_reduction)
20 write(*,*) this_image(),me
22 contains
24 pure function simple_reduction(a,b)
25 integer,intent(in) :: a,b
26 integer :: simple_reduction
28 simple_reduction = a * b
29 end function simple_reduction
31 end program simple_reduce
33 ! { dg-final { scan-tree-dump "_gfortran_caf_co_reduce \\(&desc\\.\\d+,\\s*simple_reduction," "original" } }