diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2002-12-16 18:23:00 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2002-12-16 18:23:00 +0000 |
commit | 4977bab6ed59f01c73f9c8b9e92298706df9b6d5 (patch) | |
tree | c259697c448b0c6f548f153c48c46a8d7a75970f /gcc/testsuite/gcc.dg/builtins-3.c | |
parent | b51dc045004ee7eb8d2bf4358ddf22a6cc6c1d00 (diff) | |
download | gcc-4977bab6ed59f01c73f9c8b9e92298706df9b6d5.tar.gz |
Merge basic-improvements-branch to trunk
From-SVN: r60174
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtins-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/builtins-3.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtins-3.c b/gcc/testsuite/gcc.dg/builtins-3.c new file mode 100644 index 00000000000..49bea5e126e --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtins-3.c @@ -0,0 +1,55 @@ +/* Copyright (C) 2002 Free Software Foundation. + + Verify that built-in math function constant folding of constant + arguments is correctly performed by the by the compiler. + + Written by Roger Sayle, 16th August 2002. */ + +/* { dg-do link } */ +/* { dg-options "-O2 -ffast-math" } */ + +extern void link_error(void); + +int main() +{ + if (sqrt (0.0) != 0.0) + link_error (); + + if (sqrt (1.0) != 1.0) + link_error (); + + if (exp (0.0) != 1.0) + link_error (); + + if (log (1.0) != 0.0) + link_error (); + + + if (sqrtf (0.0f) != 0.0f) + link_error (); + + if (sqrtf (1.0f) != 1.0f) + link_error (); + + if (expf (0.0f) != 1.0f) + link_error (); + + if (logf (1.0f) != 0.0f) + link_error (); + + + if (sqrtl (0.0l) != 0.0l) + link_error (); + + if (sqrtl (1.0l) != 1.0l) + link_error (); + + if (expl (0.0l) != 1.0l) + link_error (); + + if (logl (1.0l) != 0.0l) + link_error (); + + return 0; +} + |