summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/builtins-7.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-04 12:20:40 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-04 12:20:40 +0000
commit98b40778d52d75fe83505f7e6e01edb72cf2ed69 (patch)
tree0fff82636598319f282b94c466d49daa131c721d /gcc/testsuite/gcc.dg/builtins-7.c
parent4a081dddaaee9814b64009f5d4c3387203b6331e (diff)
downloadgcc-98b40778d52d75fe83505f7e6e01edb72cf2ed69.tar.gz
* 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
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtins-7.c')
-rw-r--r--gcc/testsuite/gcc.dg/builtins-7.c6
1 files changed, 6 insertions, 0 deletions
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()