Debian Codegraph @

gcc/testsuite/gfortran.dg/bounds_check_17.f90

raw
1 ! { dg-do run }
2 ! { dg-options "-fcheck=bounds" }
3 ! { dg-shouldfail "above upper bound" }
4 !
5 ! PR fortran/29800
6 !
7 ! Contributed by Joost VandeVondele
8 !
9
10 TYPE data
11 INTEGER :: x(10)
12 END TYPE
13 TYPE data_areas
14 TYPE(data) :: y(10)
15 END TYPE
16
17 TYPE(data_areas) :: z(10)
18
19 integer, volatile :: i,j,k
20 i=1 ; j=1 ; k=11
21
22 z(i)%y(j)%x(k)=0
23
24 END
25
26 ! { dg-output "At line 22 of file .*bounds_check_17.f90.*Fortran runtime error: Index '11' of dimension 1 of array 'z\.\.\.%x' above upper bound of 10" }