| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Rolls together 'len_par_06_pos.f90' and 'len_par_07_pos.f90', both of which |
| 4 |
! failed to compile. |
| 5 |
! |
| 6 |
! Contributed by Reinhold Bader <[email protected]> |
| 7 |
! |
| 8 |
module m_type_decs |
| 9 |
|
| 10 |
implicit none |
| 11 |
|
| 12 |
type :: matrix(rk, n, m) |
| 13 |
integer, kind :: rk |
| 14 |
integer, len :: n = 15, m = 20 |
| 15 |
real(rk) :: entry(n, m) |
| 16 |
end type matrix |
| 17 |
|
| 18 |
type :: fdef(rk, n) |
| 19 |
integer, kind :: rk = kind(1.0) |
| 20 |
integer, len :: n = 15 |
| 21 |
end type |
| 22 |
|
| 23 |
end module |
| 24 |
|
| 25 |
program test |
| 26 |
|
| 27 |
use m_type_decs |
| 28 |
implicit none |
| 29 |
integer, parameter :: rk1=kind(1.d0) |
| 30 |
type(matrix(rk1,:,:)), allocatable :: o_matrix |
| 31 |
type(fdef(n=:)), allocatable :: o_fdef |
| 32 |
|
| 33 |
allocate(matrix(rk=rk1)::o_matrix) |
| 34 |
|
| 35 |
if (o_matrix%n == 15 .and. o_matrix%m == 20) then |
| 36 |
write(*,*) 'o_matrix OK' |
| 37 |
else |
| 38 |
write(*,*) 'o_matrix FAIL' |
| 39 |
STOP 1 |
| 40 |
end if |
| 41 |
|
| 42 |
allocate(fdef(n=12)::o_fdef) |
| 43 |
|
| 44 |
if (o_fdef%n == 12) then |
| 45 |
write(*,*) 'o_fdef OK' |
| 46 |
else |
| 47 |
write(*,*) 'o_fdef FAIL' |
| 48 |
STOP 2 |
| 49 |
end if |
| 50 |
end program test |
| 51 |
|
| 52 |
|