summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/matmul_bounds_9.f90
blob: 5552e40657d09c903c6987ad0efb26d4cdc94a01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do run }
! { dg-options "-fbounds-check -ffrontend-optimize" }
! { dg-shouldfail "Fortran runtime error: Incorrect extent in argument B in MATMUL intrnisic for dimension 2: is 1, should be 2" }
module x
  implicit none
contains
  subroutine mmul(c, a, b)
    real, dimension(:,:), intent(in) :: a,b
    real, dimension(:,:), intent(out) :: c
    c = matmul(a,transpose(b))
  end subroutine mmul
end module x

program main
  use x
  integer, parameter :: n = 3, m=4, cnt=2
  real, dimension(n,cnt) :: a
  real, dimension(m,cnt-1) :: b
  real, dimension(n,m) :: c
  a = 1.0
  b = 2.3
  call mmul(c,a,b)
end program main