re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git] / gcc / testsuite / gfortran.dg / bound_simplification_3.f90
blob2a03f3b7f67dd312b5fdf73cceade9e4aaeafb15
1 ! { dg-do compile }
2 ! { dg-options "-fdump-tree-original" }
4 ! PR fortran/54208
5 ! The I and J definitions used to raise an error because ARR's array spec
6 ! was resolved to late for the LBOUND and UBOUND calls to be simplified to
7 ! a constant.
9 ! Contributed by Carlos A. Cruz <carlos.a.cruz@nasa.gov>
11 program testit
12 integer, parameter :: n=2
13 integer, dimension(1-min(n,2)/2:n) :: arr
14 integer, parameter :: i=lbound(arr,1)
15 integer, parameter :: j=ubound(arr,1)
16 ! write(6,*) i, j
17 if (i /= 0) STOP 1
18 if (j /= 2) STOP 2
19 end program testit
21 ! { dg-final { scan-tree-dump-times "bound" 0 "original" } }
22 ! { dg-final { scan-tree-dump-times "abort" 0 "original" } }