1  /* { dg-do compile } */
       2  /* { dg-options "-Ofast -fmath-errno -fdump-tree-optimized" } */
       3  
       4  extern float sinhf (float);
       5  extern float coshf (float);
       6  extern float atanhf (float);
       7  extern float sqrtf (float);
       8  extern double sinh (double);
       9  extern double cosh (double);
      10  extern double atanh (double);
      11  extern double sqrt (double);
      12  extern long double sinhl (long double);
      13  extern long double coshl (long double);
      14  extern long double atanhl (long double);
      15  extern long double sqrtl (long double);
      16  
      17  double __attribute__ ((noinline))
      18  sinhatanh_ (double x)
      19  {
      20      return sinh (atanh (x));
      21  }
      22  
      23  double __attribute__ ((noinline))
      24  coshatanh_ (double x)
      25  {
      26      return cosh (atanh (x));
      27  }
      28  
      29  float __attribute__ ((noinline))
      30  sinhatanhf_(float x)
      31  {
      32      return sinhf (atanhf (x));
      33  }
      34  
      35  float __attribute__ ((noinline))
      36  coshatanhf_(float x)
      37  {
      38      return coshf (atanhf (x));
      39  }
      40  
      41  long double __attribute__ ((noinline))
      42  sinhatanhl_ (long double x)
      43  {
      44      return sinhl (atanhl (x));
      45  }
      46  
      47  long double __attribute__ ((noinline))
      48  coshatanhl_ (long double x)
      49  {
      50      return coshl (atanhl (x));
      51  }
      52  
      53  /* There should be calls to sinh, cosh and atanh */
      54  /* { dg-final { scan-tree-dump-times "cosh " "1" "optimized" } } */
      55  /* { dg-final { scan-tree-dump-times "sinh " "1" "optimized" } } */
      56  /* { dg-final { scan-tree-dump-times "atanh " "2" "optimized" } } */
      57  /* { dg-final { scan-tree-dump-times "coshf " "1" "optimized" } } */
      58  /* { dg-final { scan-tree-dump-times "sinhf " "1" "optimized" } } */
      59  /* { dg-final { scan-tree-dump-times "atanhf " "2" "optimized" } } */
      60  /* { dg-final { scan-tree-dump-times "coshl " "1" "optimized" } } */
      61  /* { dg-final { scan-tree-dump-times "sinhl " "1" "optimized" } } */
      62  /* { dg-final { scan-tree-dump-times "atanhl " "2" "optimized" } } */