libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_constructor_34.f90
blob1a0931a3f2531d6cbb2fd4ff37cf5d73eb79b367
1 ! { dg-do compile }
2 ! PR32489 Endless loop when compiling.
3 ! Derived from fft257.f90, Public domain 2004 James Van Buskirk.
4 ! Note: The problem solved here was not an infinite loop issue. Middle-end
5 ! could not handle the array constructor unfolded by the front end.
6 ! WARNING: Potential resource hog.
7 ! Jerry DeLisle <jvdelisle@gcc.gnu.org>
8 program test
9 implicit none
10 integer, parameter :: dp = selected_real_kind(15,300)
11 integer, parameter :: N = 257
12 complex(dp) h1(0:N-1)
13 complex(dp) h2(0:N-1)
14 complex(dp) hh(0:N-1)
15 complex(dp), parameter :: ri(2) = (/(1,0),(0,1)/)
16 integer i, j, k, L
17 real(dp) pi
19 pi = 4*atan(1.0_dp)
20 do i = 0, N-1
21 do j = 1, 2
22 h2 = 0
23 h2(i) = ri(j)
24 h1 = (/(sum((/(exp(-2*pi*(0,1)*mod(k*L,N)/N)*h2(L),L=0,N-1)/)),k=0,N-1)/)
25 end do
26 end do
27 end program test