Debian Codegraph @

gcc/testsuite/gfortran.dg/coarray/get_with_scalar_fn.f90

raw
1 !{ dg-do run }
2
3 ! Check that non-pure/non-elemental functions in caf(fn(..))[..]
4 ! are outlined to be called on this image.
5
6 program get_with_fn_parameter
7
8 implicit none
9
10 integer, allocatable :: caf(:)[:]
11 integer, parameter :: i = 10
12 integer :: n
13
14 allocate(caf(i)[*], source =(/(n, n = i, 1, -1)/))
15 do n = 1, i
16 if (caf(pivot(n))[1] /= i - pivot(n) + 1) stop n
17 end do
18 deallocate(caf)
19
20 contains
21
22 function pivot(n)
23 integer, intent(in) :: n
24 integer :: pivot
25
26 pivot = i - n + 1
27 end function
28
29 end program
30