view gcc/testsuite/gfortran.dg/matmul_bounds_9.f90 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { 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