gcc/testsuite/gfortran.dg/array_function_6.f90
raw| 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 |
| 12 | |
| 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 |