2017-02-19 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / submodule_23.f90
blob63674fb499357d0aa50245d5ea1d07670064817a
1 ! { dg-do compile }
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'.
7 ! Contributed by Chris Coutinho <chrisbcoutinho@gmail.com>
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
17 end module mod
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
27 use mod
28 print *, fun1(10)
29 end