URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [array_constructor_4.f90] - Rev 154
Compare with Previous | Blame | View Log
! { dg-do run }
! PR 21912
! We didn't adapt the exit condition to negative steps in array constructors,
! leaving the resulting arrays uninitialized.
integer :: i(5), n, m, l, k
n = 5
i = (/ (m, m = n, 1, -1) /)
if (any (i /= (/ 5, 4, 3, 2, 1 /))) call abort
k = 1
i(5:1:-1) = (/ (m, m = n, k, -1) /)
if (any (i /= (/ 1, 2, 3, 4, 5 /))) call abort
l = -1
i = (/ (m, m = n, 1, l) /)
if (any (i /= (/ 5, 4, 3, 2, 1 /))) call abort
i(5:1:-1) = (/ (m, m = n, k, l) /)
if (any (i /= (/ 1, 2, 3, 4, 5 /))) call abort
end