1 /* Copyright (C) 2003 Free Software Foundation.
3 Verify that built-in math function constant folding doesn't
4 cause any problems for the compiler.
6 Written by Roger Sayle, 7th June 2003. */
8 /* { dg-do compile } */
9 /* { dg-options "-O2 -ffast-math" } */
11 double test1(double x)
16 double test2(double x)
18 return fabs(sqrt(x)+2.0);
21 double test3(double x)
23 return fabs(3.0*exp(x));
33 return fabsf(sqrtf(x)+2.0f);
38 return fabsf(3.0f*expf(x));
41 long double test1l(long double x)
46 long double test2l(long double x)
48 return fabsl(sqrtl(x)+2.0l);
51 long double test3l(long double x)
53 return fabsl(3.0l*expl(x));