c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / matmul_4.f90
blob164099d9fbe50147e1c2ceab321d83a3f89b07ca
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/))) STOP 1
22 end program gfcbug40