1 /* { dg-do compile } */
2 /* { dg-options "-Ofast -fdump-tree-optimized" } */
3 /* { dg-require-effective-target c99_runtime } */
5 extern float sinhf (float);
6 extern float tanhf (float);
7 extern double sinh (double);
8 extern double tanh (double);
9 extern long double sinhl (long double);
10 extern long double tanhl (long double);
12 double __attribute__ ((noinline
))
13 tanhbysinh_ (double x
)
15 return tanh (x
) / sinh (x
);
18 float __attribute__ ((noinline
))
19 tanhbysinhf_ (float x
)
21 return tanhf (x
) / sinhf (x
);
24 long double __attribute__ ((noinline
))
25 tanhbysinhl_ (long double x
)
27 return tanhl (x
) / sinhl (x
);
31 /* There must be no calls to sinh or atanh */
32 /* There must be calls to cosh */
33 /* {dg-final { scan-tree-dump-not "sinh " "optimized" } } */
34 /* {dg-final { scan-tree-dump-not "tanh " "optimized" }} */
35 /* {dg-final { scan-tree-dump-not "sinhf " "optimized" } } */
36 /* {dg-final { scan-tree-dump-not "tanhf " "optimized" }} */
37 /* {dg-final { scan-tree-dump-not "sinhl " "optimized" } } */
38 /* {dg-final { scan-tree-dump-not "tanhl " "optimized" }} */
39 /* { dg-final { scan-tree-dump "cosh " "optimized" } } */
40 /* { dg-final { scan-tree-dump "coshf " "optimized" } } */
41 /* { dg-final { scan-tree-dump "coshl " "optimized" } } */