2 ! { dg-options "-ffrontend-optimize" }
3 ! PR 66111 - this used to ICE with matmul inlining.
4 ! Original test case by Mikael Morin.
7 integer, parameter :: n
= 4
8 integer, dimension(n
, n
) :: a
, b
, c
9 integer, dimension(n
*n
) :: p
, res
, res2
10 integer, dimension(n
) :: v
14 p
= [ +59, -53, +47, -43, &
18 a
= reshape(p
, shape(a
))
19 b
= reshape([(i
, i
=1, size(a
))], shape(b
))
22 res
= [ + 14, - 22, + 16, - 22, &
23 +150, -158, +128, -138, &
24 +286, -294, +240, -254, &
25 +422, -430, +352, -370 ]
27 if (any(c
/= reshape(res
, shape(c
)))) STOP 1
29 if (any(c(:,v
) /= reshape(res
, shape(c
)))) STOP 2
31 if (any(c(v
,:) /= reshape(res
, shape(c
)))) STOP 3
33 c
= matmul(a(:,v
),b(v
,:))
34 if (any(c
/= reshape(res
, shape(c
)))) STOP 4