| 1 |
! { dg-do run } |
| 2 |
! { dg-options "-fdump-tree-original" } |
| 3 |
! |
| 4 |
! PR fortran/56318 |
| 5 |
! |
| 6 |
! Contributed by Alberto Luaces |
| 7 |
! |
| 8 |
SUBROUTINE mass_matrix |
| 9 |
DOUBLE PRECISION,PARAMETER::m1=1.d0 |
| 10 |
DOUBLE PRECISION,DIMENSION(3,2),PARAMETER::A1=reshape([1.d0,0.d0, 0.d0, & |
| 11 |
0.d0,1.d0, 0.d0],[3,2]) |
| 12 |
DOUBLE PRECISION,DIMENSION(2,2),PARAMETER::Mel=reshape([1.d0/3.d0, 0.d0, & |
| 13 |
0.d0, 1.d0/3.d0],[2,2]) |
| 14 |
|
| 15 |
DOUBLE PRECISION,DIMENSION(3,3)::MM1 |
| 16 |
|
| 17 |
MM1=m1*matmul(A1,matmul(Mel,transpose(A1))) |
| 18 |
!print '(3f8.3)', MM1 |
| 19 |
if (any (abs (MM1 & |
| 20 |
- reshape ([1.d0/3.d0, 0.d0, 0.d0, & |
| 21 |
0.d0, 1.d0/3.d0, 0.d0, & |
| 22 |
0.d0, 0.d0, 0.d0], & |
| 23 |
[3,3])) > epsilon(1.0d0))) & |
| 24 |
STOP 1 |
| 25 |
END SUBROUTINE mass_matrix |
| 26 |
|
| 27 |
program name |
| 28 |
implicit none |
| 29 |
integer, parameter :: A(3,2) = reshape([1,2,3,4,5,6],[3,2]) |
| 30 |
integer, parameter :: B(2,3) = reshape([3,17,23,31,43,71],[2,3]) |
| 31 |
integer, parameter :: C(3) = [-5,-7,-21] |
| 32 |
integer, parameter :: m1 = 1 |
| 33 |
|
| 34 |
! print *, matmul(B,C) |
| 35 |
if (any (matmul(B,C) /= [-1079, -1793])) STOP 2 |
| 36 |
! print *, matmul(C,A) |
| 37 |
if (any (matmul(C,A) /= [-82, -181])) STOP 3 |
| 38 |
! print '(3i5)', m1*matmul(A,B) |
| 39 |
if (any (m1*matmul(A,B) /= reshape([71,91,111, 147,201,255, 327,441,555],& |
| 40 |
[3,3]))) & |
| 41 |
STOP 4 |
| 42 |
call mass_matrix |
| 43 |
end program name |
| 44 |
|
| 45 |
! { dg-final { scan-tree-dump-times "matmul" 0 "original" } } |
| 46 |
|