2018-09-30 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / matmul_bounds_9.f90
blob5552e40657d09c903c6987ad0efb26d4cdc94a01
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check -ffrontend-optimize" }
3 ! { dg-shouldfail "Fortran runtime error: Incorrect extent in argument B in MATMUL intrnisic for dimension 2: is 1, should be 2" }
4 module x
5 implicit none
6 contains
7 subroutine mmul(c, a, b)
8 real, dimension(:,:), intent(in) :: a,b
9 real, dimension(:,:), intent(out) :: c
10 c = matmul(a,transpose(b))
11 end subroutine mmul
12 end module x
14 program main
15 use x
16 integer, parameter :: n = 3, m=4, cnt=2
17 real, dimension(n,cnt) :: a
18 real, dimension(m,cnt-1) :: b
19 real, dimension(n,m) :: c
20 a = 1.0
21 b = 2.3
22 call mmul(c,a,b)
23 end program main