Debian Codegraph @

gcc/testsuite/gfortran.dg/pr108131.f90

raw
1 ! { dg-do run }
2 ! { dg-additional-options "-fdump-tree-original" }
3 ! PR fortran/108131
4 !
5 ! Incorrect array bounds when bound intrinsic used in declaration
6
7 program test
8 implicit none
9 integer, parameter :: mg(7:10) = 0
10 integer, parameter :: u = ubound(mg, dim=1)
11 integer, parameter :: cx(-1:ubound(mg, dim=1)) = 1
12 integer, parameter :: dx(lbound(mg, dim=1):ubound(cx, dim=1)) = 2
13
14 write(*,*) ubound(mg, dim=1)
15 write(*,*) ubound(cx, dim=1)
16 if (u /= 10) stop 1
17 if (ubound(mg, dim=1) /= 10) stop 2
18 if (ubound(cx, dim=1) /= 10) stop 3
19 if (ubound(dx, dim=1) /= 10) stop 4
20 if (lbound(mg, dim=1) /= 7) stop 5
21 if (lbound(cx, dim=1) /= -1) stop 6
22 if (lbound(dx, dim=1) /= 7) stop 7
23 end program test
24
25 ! { dg-final { scan-tree-dump-not "_gfortran_stop_numeric" "original" } }