4 ! In the transposed case call to my_mul_cont, the compiler used to (wrongly)
5 ! reuse a transposed descriptor for an array that was not transposed as a result
8 ! Original test case from Alexander Vogt <a.vogt@fulguritus.com>.
13 integer, dimension(2,2) :: A
, R
, RT
14 integer, dimension(2,2) :: B1
, B2
20 ! matmul(a,a) = [ 1398 4403 ]
23 ! matmul(transpose(a), a) = [ 6728 21108 ]
45 ! print *,'Normal: ',maxval(abs(B1-B2))
48 if (any(B1
/= R
)) STOP 1
49 if (any(B2
/= R
)) STOP 2
54 B1
= my_mul(transpose(A
),A
)
55 B2
= my_mul_cont(transpose(A
),A
)
56 ! print *,'Transposed:',maxval(abs(B1-B2))
59 if (any(B1
/= RT
)) STOP 3
60 if (any(B2
/= RT
)) STOP 4
64 function my_mul(A
,C
) result (B
)
65 use, intrinsic :: ISO_Fortran_env
66 integer, intent(in
) :: A(2,2), C(2,2)
71 function my_mul_cont(A
,C
) result (B
)
72 use, intrinsic :: ISO_Fortran_env
73 integer, intent(in
), contiguous
:: A(:,:), C(:,:)