From ba78d4526f495d25a2d23025a4d782bfe73b591b Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Thu, 10 Feb 2005 15:16:51 +0000 Subject: builtins.c (fold_builtin_powi): New function. 2005-02-10 Richard Guenther * builtins.c (fold_builtin_powi): New function. (fold_builtin_1): Call it. * gcc.dg/builtins-52.c: New testcase. From-SVN: r94831 --- gcc/testsuite/gcc.dg/builtins-52.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/builtins-52.c (limited to 'gcc/testsuite/gcc.dg/builtins-52.c') diff --git a/gcc/testsuite/gcc.dg/builtins-52.c b/gcc/testsuite/gcc.dg/builtins-52.c new file mode 100644 index 0000000..684fd66 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtins-52.c @@ -0,0 +1,23 @@ +/* { dg-do link } */ +/* { dg-options "-ffast-math" } */ + +extern void link_error(void); + +void test(double x, int n) +{ + if (__builtin_powi(x,-1.0) != 1.0/x) + link_error (); + if (__builtin_powi(x,0.0) != 1.0) + link_error (); + if (__builtin_powi(x,1.0) != x) + link_error (); + if (__builtin_powi(1.0,n) != 1.0) + link_error (); +} + +int main() +{ + test(7.3, 2); + return 0; +} + -- cgit v1.1