aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/bounds_check_17.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.dg/bounds_check_17.f90')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/bounds_check_17.f9026
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/bounds_check_17.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/bounds_check_17.f90
new file mode 100644
index 000000000..50d66c75a
--- /dev/null
+++ b/gcc-4.9/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" }