2 ! Test MATMUL for various arguments and results
3 ! (test values checked with GNU octave).
4 ! PR18857 was due to an incorrect assertion that component base==0
5 ! for both input arguments and the result.
6 ! provided by Paul Thomas - pault@gcc.gnu.org
9 integer, parameter :: N = 5
10 integer, parameter :: T = 4
12 real(kind=T), dimension(:,:), allocatable :: a, b, c
13 real(kind=T), dimension(N,N) :: x, y, z
15 allocate (a(2*N, N), b(N, N), c(2*N, N))
31 if (sum (z) /= 750.0_T) call abort ()
36 c(1:3,1:2) = matmul (a(7:9,3:N), b(3:N,3:4))
37 if (sum (c) /= 576.0_T) call abort ()
43 if (sum (c) /= 9625.0_T) call abort ()
49 if (sum (c) /= 5775.0_T) call abort ()