| 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 <[email protected]> |
| 7 |
! |
| 8 |
module m1 |
| 9 |
integer :: numclusters = 2 |
| 10 |
end module m1 |
| 11 |
|
| 12 |
module 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 |
| 18 |
end module m2 |
| 19 |
|
| 20 |
program kmeans_driver |
| 21 |
use m1 |
| 22 |
use m2 |
| 23 |
integer :: nfirst(3) |
| 24 |
nfirst(1:numclusters) = get_nfirst( ) |
| 25 |
end program kmeans_driver |