diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/cshift_bounds_4.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/cshift_bounds_4.f90 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/cshift_bounds_4.f90 b/gcc/testsuite/gfortran.dg/cshift_bounds_4.f90 new file mode 100644 index 000000000..4a3fcfbd1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/cshift_bounds_4.f90 @@ -0,0 +1,13 @@ +! { dg-do run } +! { dg-shouldfail "Incorrect extent in SHIFT argument of CSHIFT intrinsic in dimension 1: is 3, should be 2" } +! { dg-options "-fbounds-check" } +program main + integer, dimension(:,:), allocatable :: a, b + integer, dimension(:), allocatable :: sh + allocate (a(2,2)) + allocate (b(2,2)) + allocate (sh(3)) + a = 1 + b = cshift(a,sh) +end program main +! { dg-output "Fortran runtime error: Incorrect extent in SHIFT argument of CSHIFT intrinsic in dimension 1: is 3, should be 2" } |