diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/bounds_check_17.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/bounds_check_17.f90 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/bounds_check_17.f90 b/gcc/testsuite/gfortran.dg/bounds_check_17.f90 new file mode 100644 index 0000000000..50d66c75a8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bounds_check_17.f90 @@ -0,0 +1,26 @@ +! { dg-do run } +! { dg-options "-fcheck=bounds" } +! { dg-shouldfail "above upper bound" } +! +! PR fortran/29800 +! +! Contributed by Joost VandeVondele +! + +TYPE data + INTEGER :: x(10) +END TYPE +TYPE data_areas + TYPE(data) :: y(10) +END TYPE + +TYPE(data_areas) :: z(10) + +integer, volatile :: i,j,k +i=1 ; j=1 ; k=11 + +z(i)%y(j)%x(k)=0 + +END + +! { dg-output "At line 22 of file .*bounds_check_17.f90.*Fortran runtime error: Index '11' of dimension 1 of array 'z%y%x' above upper bound of 10" } |