diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/spread_bounds_1.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/spread_bounds_1.f90 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/spread_bounds_1.f90 b/gcc/testsuite/gfortran.dg/spread_bounds_1.f90 new file mode 100644 index 000000000..7e5bc651f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/spread_bounds_1.f90 @@ -0,0 +1,12 @@ +! { dg-do run } +! { dg-options "-fbounds-check" } +! { dg-shouldfail "Incorrect extent in return value of SPREAD intrinsic in dimension 2: is 3, should be 2" } +program main + integer :: source(2), target(2,3) + data source /1,2/ + integer :: times + times = 2 + target = spread(source,2,times) +end program main +! { dg-output "Fortran runtime error: Incorrect extent in return value of SPREAD intrinsic in dimension 2: is 3, should be 2" + |