1! { dg-do compile }
2! { dg-options "-Wreturn-type" }
3! Tests the fix of PR34545, in which the 'numclusters' that determines the size
4! of fnres was not properly associated.
5!
6! Reported by Jon D. Richards <jon_d_r@msn.com>
7!
8module m1
9  integer :: numclusters = 2
10end module m1
11
12module m2
13  contains
14    function get_nfirst( ) result(fnres)  ! { dg-warning "not set" }
15      use m1, only: numclusters
16      real :: fnres(numclusters)   ! change to REAL and it works!!
17    end function get_nfirst
18end module m2
19
20program kmeans_driver
21   use m1
22   use m2
23   integer :: nfirst(3)
24   nfirst(1:numclusters) = get_nfirst( )
25end program kmeans_driver
26