| 1 |
! { dg-do compile } |
| 2 |
! Test the patch for PR30081 in which non-generic intrinsic |
| 3 |
! procedures could not be overloaded by generic interfaces. |
| 4 |
! |
| 5 |
! Contributed by Harald Anlauf <[email protected]> |
| 6 |
! |
| 7 |
module gfcbug46 |
| 8 |
interface random_seed |
| 9 |
module procedure put_seed |
| 10 |
end interface |
| 11 |
interface random_number |
| 12 |
module procedure random_vector |
| 13 |
end interface |
| 14 |
type t_t |
| 15 |
real :: x(2) |
| 16 |
end type t_t |
| 17 |
contains |
| 18 |
subroutine put_seed (n, seed) |
| 19 |
integer, intent(inout) :: n |
| 20 |
integer, intent(in) :: seed |
| 21 |
call random_seed (size=n) |
| 22 |
end subroutine put_seed |
| 23 |
subroutine random_vector (t) |
| 24 |
type(t_t) :: t |
| 25 |
call random_number (t% x) |
| 26 |
end subroutine random_vector |
| 27 |
end module gfcbug46 |
| 28 |
|
| 29 |
use gfcbug46 |
| 30 |
type(t_t) :: z |
| 31 |
integer :: n = 2, seed = 1 |
| 32 |
call put_seed (n, seed) |
| 33 |
call random_number (z) |
| 34 |
print *, z |
| 35 |
end |