| 1 |
! { dg-do run } |
| 2 |
! PR 84931 - long array constructors with type conversion were not |
| 3 |
! handled correctly. array_constructor_52.f90 tests the original |
| 4 |
! problem. |
| 5 |
program test |
| 6 |
implicit none |
| 7 |
integer, parameter :: n = 2**16 + 1 |
| 8 |
real, dimension(n) :: y |
| 9 |
real, dimension(2*n) :: z |
| 10 |
integer :: i |
| 11 |
|
| 12 |
y = [33, (1, i=1, n-1) ] ! Check that something more complicated works |
| 13 |
if (int(y(3)) /= 1) stop 1 |
| 14 |
|
| 15 |
z = [[(1, i=1, n) ],[(2, i=1, n) ]] ! Failed with first version of the fix |
| 16 |
|
| 17 |
if (int(z(2)) /= 1) stop 2 |
| 18 |
if (int(z(n+1)) /= 2) stop 3 |
| 19 |
end program test |