2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_function_6.f90
blob3dab43dcb8139940a116c4674b5f6e922e286b9d
1 ! { dg-do run }
2 ! PR46842 wrong results with MATMUL(..., TRANSPOSE (func ()))
3 implicit none
4 call sub()
5 contains
6 subroutine sub()
7 real, dimension(2,2) :: b
8 b = 1.0
9 b = matmul(b,transpose(func()))
10 if (any(b.ne.reshape((/ 4.0, 4.0, 6.0, 6.0 /),[2,2]) )) print *, b
11 end subroutine
13 function func() result(res)
14 real, dimension(2,2) :: res
15 res = reshape([1,2,3,4], [2,2])
16 end function
17 end