| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fdump-tree-original" } |
| 3 |
! |
| 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. |
| 8 |
! |
| 9 |
! Contributed by Carlos A. Cruz <[email protected]> |
| 10 |
|
| 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 |
| 20 |
|
| 21 |
! { dg-final { scan-tree-dump-times "bound" 0 "original" } } |
| 22 |
! { dg-final { scan-tree-dump-times "_gfortran_stop" 0 "original" } } |