2018-03-30 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_constructor_53.f90
blob8f7c87fe96cfaae8b93bf59b1ce5c5dfd43fa3dd
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
12 y = [33, (1, i=1, n-1) ] ! Check that something more complicated works
13 if (int(y(3)) /= 1) stop 1
15 z = [[(1, i=1, n) ],[(2, i=1, n) ]] ! Failed with first version of the fix
17 if (int(z(2)) /= 1) stop 2
18 if (int(z(n+1)) /= 2) stop 3
19 end program test