1 ! Program to test derived types
5 integer, dimension (4, 5) :: a
11 type (t1
), dimension (4, 3) :: ca
21 type (init_type
) :: def_init
22 type (init_type
) :: is_init
= init_type (10, 11)
25 if ((def_init
%i
.ne
. 13) .or
. (def_init
%j
.ne
. 14)) call abort
26 if ((is_init
%i
.ne
. 10) .or
. (is_init
%j
.ne
. 11)) call abort
27 ! Passing a component as a parameter tests getting the addr of a component
28 call test_call(def_init
%i
)
30 if (var
%c
.ne
. "Hello World") call abort
35 var
%ca(:, :)%s
= var
%r
%a(:, 1:5:2)
36 if (var
%ca(1, 1)%s
.ne
. 42) call abort
37 if (var
%ca(4, 3)%s
.ne
. 43) call abort
39 subroutine test_call (p
)
42 if (p
.ne
. 13) call abort