aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/bounds_check_17.f90
blob: 50d66c75a80973e157019f50a5baaad891010a95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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" }