Debian Codegraph @

gcc/testsuite/gfortran.fortran-torture/execute/retarray_2.f90

raw
1 ! Procedure to test module procedures returning arrays.
2 ! The array spec only gets applied to the result variable, not the function
3 ! itself. As a result we missed it during resolution, and used the wrong
4 ! calling convention (functions returning arrays must always have explicit
5 ! interfaces).
6 module retarray_2
7 contains
8 function z(a) result (aout)
9 integer, dimension(4) :: aout,a
10 aout = a
11 end function z
12 end module retarray_2
13
14 program retarray
15 use retarray_2
16 integer, dimension(4) :: b, a=(/1,2,3,4/)
17 b = z(a)
18 if (any (b .ne. (/1, 2, 3, 4/))) STOP 1
19 end
20