summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/matmul_bounds_15.f
blob: db4627adb9fdf0c1a6ae8cbea061481aaee04d93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
C { dg-do  run }
C { dg-options "-fdump-tree-optimized -fcheck=bounds -fblas-matmul-limit=1 -O -fexternal-blas" }
C { dg-shouldfail "Fortran runtime error: Incorrect extent in argument B in MATMUL intrinsic in dimension 1.*" }
C { dg-additional-sources blas_gemm_routines.f }
      program main
      character(len=20) :: line
      integer :: n, m
      real, dimension(3,2) :: a
      real, dimension(:,:), allocatable :: b
      real, dimension(:,:), allocatable :: ret
      a = 1.0
      line = '3 3'
      read (unit=line,fmt=*) n, m
      allocate (b(n,m))
      b = 2.3
      ret = matmul(a,b)         ! This should throw an error.
      end
! { dg-output "Fortran runtime error: Incorrect extent in argument B in MATMUL intrinsic in dimension 1.*" }
! { dg-final { scan-tree-dump-times "_gfortran_matmul" 0 "optimized" } }