Debian Codegraph @

gcc/testsuite/gfortran.dg/submodule_23.f90

raw
1 ! { dg-do compile }
2 !
3 ! Test the fix for PR79402, in which the module procedure 'fun1' picked
4 ! up a spurious symbol for the dummy 'n' in the specification expression
5 ! for the result 'y'.
6 !
7 ! Contributed by Chris Coutinho <[email protected]>
8 !
9 module mod
10 interface myfun
11 module function fun1(n) result(y)
12 integer, intent(in) :: n
13 real, dimension(n) :: y
14 end function fun1
15 end interface myfun
16
17 end module mod
18
19 submodule (mod) submod
20 contains
21 module procedure fun1
22 integer :: i
23 y = [(float (i), i = 1, n)]
24 end procedure fun1
25 end submodule
26
27 use mod
28 print *, fun1(10)
29 end