summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/complex_intrinsic_3.f90
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-15 11:24:46 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-15 11:24:46 +0000
commit56fcd3fede0e1c4489a3c108d95fd1ff38dfa1a5 (patch)
treef21ec6dd55e434aff16e698b0286153465775d62 /gcc/testsuite/gfortran.dg/complex_intrinsic_3.f90
parentc2ce85c4e04bda844aa35dfdf41e69e585d97b2e (diff)
downloadgcc-56fcd3fede0e1c4489a3c108d95fd1ff38dfa1a5.tar.gz
2009-07-15 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 149655 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@149682 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/complex_intrinsic_3.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/complex_intrinsic_3.f9039
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/complex_intrinsic_3.f90 b/gcc/testsuite/gfortran.dg/complex_intrinsic_3.f90
new file mode 100644
index 00000000000..f0d12d6ef14
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/complex_intrinsic_3.f90
@@ -0,0 +1,39 @@
+! { dg-do run }
+!
+! PR fortran/33197
+!
+! Fortran 2008 complex trigonometric functions: tan, cosh, sinh, tanh
+!
+implicit none
+real(4), parameter :: pi = 2*acos(0.0_4)
+real(8), parameter :: pi8 = 2*acos(0.0_8)
+real(4), parameter :: eps = 10*epsilon(0.0_4)
+real(8), parameter :: eps8 = 10*epsilon(0.0_8)
+complex(4), volatile :: z0_0 = cmplx(0.0_4, 0.0_4, kind=4)
+complex(4), volatile :: z1_1 = cmplx(1.0_4, 1.0_4, kind=4)
+complex(4), volatile :: zp_p = cmplx(pi, pi, kind=4)
+complex(8), volatile :: z80_0 = cmplx(0.0_8, 0.0_8, kind=8)
+complex(8), volatile :: z81_1 = cmplx(1.0_8, 1.0_8, kind=8)
+complex(8), volatile :: z8p_p = cmplx(pi8, pi8, kind=8)
+
+if (abs(tan(z0_0) - cmplx(0.0,0.0,4)) > eps) call abort()
+if (abs(tan(z1_1) - cmplx(0.27175257,1.0839232,4)) > eps) call abort()
+if (abs(tan(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call abort()
+if (abs(tan(z81_1) - cmplx(0.27175258531951174_8,1.0839233273386946_8,8)) > eps8) call abort()
+
+if (abs(cosh(z0_0) - cmplx(1.0,0.0,4)) > eps) call abort()
+if (abs(cosh(z1_1) - cmplx(0.83372992,0.98889768,4)) > eps) call abort()
+if (abs(cosh(z80_0) - cmplx(1.0_8,0.0_8,8)) > eps8) call abort()
+if (abs(cosh(z81_1) - cmplx(0.83373002513114913_8,0.98889770576286506_8,8)) > eps8) call abort()
+
+if (abs(sinh(z0_0) - cmplx(0.0,0.0,4)) > eps) call abort()
+if (abs(sinh(z1_1) - cmplx(0.63496387,1.2984575,4)) > eps) call abort()
+if (abs(sinh(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call abort()
+if (abs(sinh(z81_1) - cmplx(0.63496391478473613_8,1.2984575814159773_8,8)) > eps8) call abort()
+
+if (abs(tanh(z0_0) - cmplx(0.0,0.0,4)) > eps) call abort()
+if (abs(tanh(z1_1) - cmplx(1.0839232,0.27175257,4)) > eps) call abort()
+if (abs(tanh(z80_0) - cmplx(0.0_8,0.0_8,8)) > eps8) call abort()
+if (abs(tanh(z81_1) - cmplx(1.0839233273386946_8,0.27175258531951174_8,8)) > eps8) call abort()
+
+end