(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.c-torture/
execute/
pr39228.c
       1  /* { dg-add-options ieee } */
       2  
       3  extern void abort (void);
       4  
       5  static inline int __attribute__((always_inline)) testf (float b)
       6  {
       7    float c = 1.01f * b;
       8  
       9    return __builtin_isinff (c);
      10  }
      11  
      12  static inline int __attribute__((always_inline)) test (double b)
      13  {
      14    double c = 1.01 * b;
      15  
      16    return __builtin_isinf (c);
      17  }
      18  
      19  static inline int __attribute__((always_inline)) testl (long double b)
      20  {
      21    long double c = 1.01L * b;
      22  
      23    return __builtin_isinfl (c);
      24  }
      25  
      26  int main()
      27  {
      28    if (testf (__FLT_MAX__) < 1)
      29      abort ();
      30  
      31    if (test (__DBL_MAX__) < 1)
      32      abort ();
      33  
      34    if (testl (__LDBL_MAX__) < 1)
      35      abort ();
      36  
      37    return 0;
      38  }