2018-06-06 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / compile / pr85863.f
blob57673fd0461639f97922479af69210a2329e666d
1 ! { dg-do compile }
2 ! { dg-additional-options "-ffast-math -ftree-vectorize" }
3 SUBROUTINE SOBOOK(MHSO,HSOMAX,MS)
4 IMPLICIT DOUBLE PRECISION(A-H,O-Z)
5 COMPLEX*16 HSOT,HSO1(2)
6 PARAMETER (ZERO=0.0D+00,TWO=2.0D+00)
7 DIMENSION SOL1(3,2),SOL2(3)
8 CALL FOO(SOL1,SOL2)
9 SQRT2=SQRT(TWO)
10 DO IH=1,MHSO
11 IF(MS.EQ.0) THEN
12 HSO1(IH) = DCMPLX(ZERO,-SOL1(3,IH))
13 HSOT = DCMPLX(ZERO,-SOL2(3))
14 ELSE
15 HSO1(IH) = DCMPLX(-SOL1(2,IH),SOL1(1,IH))/SQRT2
16 HSOT = DCMPLX(-SOL2(2),SOL2(1))/SQRT2
17 ENDIF
18 ENDDO
19 HSOT=HSOT+HSO1(1)
20 HSOMAX=MAX(HSOMAX,ABS(HSOT))
21 RETURN
22 END