3 ! Passing TYPE to CLASS
8 real, allocatable :: B(:)
11 type(t), allocatable :: x(:)
16 if (size (x) /= 10) call abort ()
17 x = [(t(a=-i, B=[1*i,2*i,3*i,4*i]), i = 1, 10)]
19 if (x(i)%a /= -i .or. size (x(i)%b) /= 4 &
20 .or. any (x(i)%b /= [1*i,2*i,3*i,4*i])) then
25 y = x ! TODO: Segfaults in runtime without 'y' being set
28 call classExplicit(x, size(x))
30 call classExplicit(y, size(y))
34 class(t), intent(in) :: z(:)
37 if (size (z) /= 10) call abort ()
39 if (z(i)%a /= -i .or. size (z(i)%b) /= 4 &
40 .or. any (z(i)%b /= [1*i,2*i,3*i,4*i])) then
48 subroutine classExplicit(u, n)
49 integer, intent(in) :: n
50 class(t), intent(in) :: u(n)
53 if (size (u) /= 10) call abort ()
55 if (u(i)%a /= -i .or. size (u(i)%b) /= 4 &
56 .or. any (u(i)%b /= [1*i,2*i,3*i,4*i])) then
63 end subroutine classExplicit