Fix compilation failure with C++98 compilers
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr85816.f90
blobe1fa97dd493f6675e8dc5828768c48b9cd2ee8fe
1 ! { dg-do compile }
2 ! PR fortran/85816
3 ! Original code from Martin Diehl <m.diehl at mpie dot de>
5 ! Prior to fixing the problem with the array descriptor, gfortran died with
6 ! Operating system error: Cannot allocate memory
7 ! Integer overflow in xmallocarray
9 program test
10 implicit none
11 real(8) :: tensor(3,3) = 4
12 integer :: grid(3) = 16
13 ! ok
14 write(6,*) spread(spread(tensor,3,grid(1)),4,grid(1))
15 ! ok (note the brackets)
16 write(6,*) spread((spread(spread(tensor,3,grid(1)),4,grid(2))),5,grid(3))
17 ! not ok
18 write(6,*) spread(spread(spread(tensor,3,grid(1)),4,grid(2)),5,grid(3))
19 end program