summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/inline_matmul_9.f90
blob: 074936ae2ce1e05f7857fb6bb40d3745240ded18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
! { dg-do  run }
! { dg-options "-ffrontend-optimize -fdump-tree-optimized" }
! PR 66041 - this used to ICE with an incomplete fix for the PR.
program main
  implicit none
  type :: t
    real :: c
  end type t
  type(t), dimension(1,-2:0) :: a1
  real, dimension(3,2) :: b1
  real, dimension(2) :: c1
  real, dimension(1,2) :: c2

  data a1%c /17., -23., 29./
  data b1 / 2.,  -3.,  5.,  -7., 11., -13./

  c1 = matmul(a1(1,:)%c, b1)
  if (any (c1-[248., -749.] /= 0.)) STOP 1

  c2 = matmul(a1%c, b1)
  if (any (c2-reshape([248., -749.],shape(c2)) /= 0.)) STOP 2
end program main

! { dg-final { scan-tree-dump-times "_gfortran_matmul" 0 "optimized" } }