From 0c59a1963e948c546e0d3e34de974c7e71de1134 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 26 Apr 2009 01:04:54 +0000 Subject: =?UTF-8?q?*=20sysdeps/i386/fpu/s=5Fcos.S:=20Set=20errno=20for=20?= =?UTF-8?q?=C2=B1Inf.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sysdeps/i386/fpu/s_cosf.S: Likewise. * sysdeps/i386/fpu/s_cosl.S: Likewise. * sysdeps/i386/fpu/s_sin.S: Likewise. * sysdeps/i386/fpu/s_sinf.S: Likewise. * sysdeps/i386/fpu/s_sinl.S: Likewise. * sysdeps/ieee754/dbl-64/s_sin.c: Likewise. * sysdeps/ieee754/flt-32/s_cosf.c: Likewise. * sysdeps/ieee754/flt-32/s_sinf.c: Likewise. * sysdeps/ieee754/ldbl-96/s_cosl.c: Likewise. * sysdeps/ieee754/ldbl-96/s_sinl.c: Likewise. * sysdeps/x86_64/fpu/s_cosl.S: Likewise. * sysdeps/x86_64/fpu/s_sinl.S: Likewise. * math/libm-test.inc: Add tests for errno after sin/cos calls with ±Inf. --- math/libm-test.inc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'math/libm-test.inc') diff --git a/math/libm-test.inc b/math/libm-test.inc index 68f2f05a70..5f4dbe7fa1 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 1997-2006, 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1997. @@ -1993,9 +1993,15 @@ cos_test (void) TEST_f_f (cos, 0, 1); TEST_f_f (cos, minus_zero, 1); + errno = 0; TEST_f_f (cos, plus_infty, nan_value, INVALID_EXCEPTION); + check_int ("errno for cos(+inf) == EDOM", errno, EDOM, 0, 0, 0); + errno = 0; TEST_f_f (cos, minus_infty, nan_value, INVALID_EXCEPTION); + check_int ("errno for cos(-inf) == EDOM", errno, EDOM, 0, 0, 0); + errno = 0; TEST_f_f (cos, nan_value, nan_value); + check_int ("errno for cos(NaN) unchanged", errno, 0, 0, 0, 0); TEST_f_f (cos, M_PI_6l * 2.0, 0.5); TEST_f_f (cos, M_PI_6l * 4.0, -0.5); @@ -5497,9 +5503,15 @@ sin_test (void) TEST_f_f (sin, 0, 0); TEST_f_f (sin, minus_zero, minus_zero); + errno = 0; TEST_f_f (sin, plus_infty, nan_value, INVALID_EXCEPTION); + check_int ("errno for sin(+inf) == EDOM", errno, EDOM, 0, 0, 0); + errno = 0; TEST_f_f (sin, minus_infty, nan_value, INVALID_EXCEPTION); + check_int ("errno for sin(-inf) == EDOM", errno, EDOM, 0, 0, 0); + errno = 0; TEST_f_f (sin, nan_value, nan_value); + check_int ("errno for sin(NaN) unchanged", errno, 0, 0, 0, 0); TEST_f_f (sin, M_PI_6l, 0.5); TEST_f_f (sin, -M_PI_6l, -0.5); -- cgit v1.2.1