gcc/testsuite/gfortran.dg/matmul_bounds_7.f90
raw| 1 | ! { dg-do run } |
| 2 | ! { dg-additional-options "-fcheck=bounds" } |
| 3 | ! { dg-shouldfail "Fortran runtime error: dimension of array B incorrect in MATMUL intrinsic" } |
| 4 | |
| 5 | program main |
| 6 | real, dimension(3,2) :: a |
| 7 | real, dimension(6) :: b |
| 8 | real, dimension(:), allocatable :: c |
| 9 | |
| 10 | data a /-2., 3., -5., 7., -11., 13./ |
| 11 | data b /17., -23., 29., -31., 37., -41./ |
| 12 | |
| 13 | c = matmul(pack(b,[b<20.]),a) |
| 14 | print *,sum(c) |
| 15 | |
| 16 | end program main |