From 98b40778d52d75fe83505f7e6e01edb72cf2ed69 Mon Sep 17 00:00:00 2001 From: sayle Date: Wed, 4 Jun 2003 12:20:40 +0000 Subject: * builtins.c (dconstpi, dconste): New mathematical constants. (init_builtin_dconsts): New function to initialize dconstpi and dconste. (fold_builtin): Optimize exp(1.0) = e. Evaluate exp(x) at compile time with -ffast-math when x is an integer constant. Optimize tan(0.0) = 0.0. Optimize atan(0.0) = 0.0, atan(1.0) = pi/4 and tan(atan(x)) = x with -ffast-math. * gcc.dg/builtins-2.c: Add tests for tan(atan(x)). * gcc.dg/builtins-3.c: Add tests for tan(0.0) and atan(0.0). * gcc.dg/builtins-7.c: Add tests for tan(atan(x)) == x. * gcc.dg/builtins-17.c: New test case. * gcc.dg/i386-387-4.c: New test case. * gcc.c-torture/execute/ieee/mzero4.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67438 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.dg/builtins-7.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/testsuite/gcc.dg/builtins-7.c') diff --git a/gcc/testsuite/gcc.dg/builtins-7.c b/gcc/testsuite/gcc.dg/builtins-7.c index 84c0e154fa0..87995a4d3a0 100644 --- a/gcc/testsuite/gcc.dg/builtins-7.c +++ b/gcc/testsuite/gcc.dg/builtins-7.c @@ -14,18 +14,24 @@ void test(double x) { if (pow (x, 1.0) != x) link_error (); + if (tan (atan (x)) != x) + link_error (); } void testf(float x) { if (powf (x, 1.0f) != x) link_error (); + if (tanf (atanf (x)) != x) + link_error (); } void testl(long double x) { if (powl (x, 1.0l) != x) link_error (); + if (tanl (atanl (x)) != x) + link_error (); } int main() -- cgit v1.2.1