2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / complex_intrinsic_7.f90
blob3cc67bd8776134b4e968fd75da4698519d9c8e2f
1 ! { dg-do compile }
2 ! { dg-options "-fdump-tree-original" }
4 ! PR fortran/33197
6 ! Fortran 2008 complex trigonometric functions: tan, cosh, sinh, tanh
8 ! Compile-time simplificiations
10 implicit none
11 real(4), parameter :: pi = 2*acos(0.0_4)
12 real(8), parameter :: pi8 = 2*acos(0.0_8)
13 real(4), parameter :: eps = 10*epsilon(0.0_4)
14 real(8), parameter :: eps8 = 10*epsilon(0.0_8)
15 complex(4), parameter :: z0_0 = cmplx(0.0_4, 0.0_4, kind=4)
16 complex(4), parameter :: z1_1 = cmplx(1.0_4, 1.0_4, kind=4)
17 complex(4), parameter :: zp_p = cmplx(pi, pi, kind=4)
18 complex(8), parameter :: z80_0 = cmplx(0.0_8, 0.0_8, kind=8)
19 complex(8), parameter :: z81_1 = cmplx(1.0_8, 1.0_8, kind=8)
20 complex(8), parameter :: z8p_p = cmplx(pi8, pi8, kind=8)
22 if (abs(tan(z0_0) - cmplx(0.0,0.0,4)) > eps) STOP 1
23 if (abs(tan(z1_1) - cmplx(0.27175257,1.0839232,4)) > eps) STOP 2
24 if (abs(tan(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) STOP 3
25 if (abs(tan(z81_1) - cmplx(0.27175258531951174_8,1.0839233273386946_8,8)) > eps8) STOP 4
27 if (abs(cosh(z0_0) - cmplx(1.0,0.0,4)) > eps) STOP 5
28 if (abs(cosh(z1_1) - cmplx(0.83372992,0.98889768,4)) > eps) STOP 6
29 if (abs(cosh(z80_0) - cmplx(1.0_8,0.0_8,8)) > eps8) STOP 7
30 if (abs(cosh(z81_1) - cmplx(0.83373002513114913_8,0.98889770576286506_8,8)) > eps8) STOP 8
32 if (abs(sinh(z0_0) - cmplx(0.0,0.0,4)) > eps) STOP 9
33 if (abs(sinh(z1_1) - cmplx(0.63496387,1.2984575,4)) > eps) STOP 10
34 if (abs(sinh(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) STOP 11
35 if (abs(sinh(z81_1) - cmplx(0.63496391478473613_8,1.2984575814159773_8,8)) > eps8) STOP 12
37 if (abs(tanh(z0_0) - cmplx(0.0,0.0,4)) > eps) STOP 13
38 if (abs(tanh(z1_1) - cmplx(1.0839232,0.27175257,4)) > eps) STOP 14
39 if (abs(tanh(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) STOP 15
40 if (abs(tanh(z81_1) - cmplx(1.0839233273386946_8,0.27175258531951174_8,8)) > eps8) STOP 16
42 end
43 ! { dg-final { scan-tree-dump-times "abort" 0 "original" } }