(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
tanhbysinh.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-Ofast -fdump-tree-optimized" } */
       3  /* { dg-require-effective-target c99_runtime } */
       4  
       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);
      11  
      12  double __attribute__ ((noinline))
      13  tanhbysinh_ (double x)
      14  {
      15      return tanh (x) / sinh (x);
      16  }
      17  
      18  float __attribute__ ((noinline))
      19  tanhbysinhf_ (float x)
      20  {
      21      return tanhf (x) / sinhf (x);
      22  }
      23  
      24  long double __attribute__ ((noinline))
      25  tanhbysinhl_ (long double x)
      26  {
      27      return tanhl (x) / sinhl (x);
      28  }
      29  
      30  
      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" } } */