Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / matmul_4.f90
blob8bbaef934c1d0629d05ea8f5328188afacde3b25
1 ! { dg-do run }
2 ! Check the fix for PR28947, in which the mechanism for dealing
3 ! with matmul (a, transpose (b)) would cause wrong results for
4 ! a having a rank == 1.
6 ! Contributed by Harald Anlauf <anlauf@gmx.de>
7 !
8 program gfcbug40
9 implicit none
11 real :: h(3,3), mat(2,3)
13 h(:,:) = - HUGE (1.0)/4 ! Preset unused elements suitably...
15 h(3,:) = 0
16 h(3,3) = 1
17 mat(:,:) = 1
18 h(3,:) = h(3,:) + matmul (matmul (h(3,:), transpose (mat)), mat)
20 if (any (h(3,:) .ne. (/2.0, 2.0, 3.0/))) call abort ()
22 end program gfcbug40