(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
torture/
pr70457.c
       1  /* { dg-do compile } */
       2  
       3  /* This formerly ICEd when trying to expand pow as a built-in with
       4     the wrong number of arguments.  */
       5  
       6  extern double pow (double, double) __attribute__ ((__nothrow__ , __leaf__));
       7  
       8  typedef struct {
       9    long long data;
      10    int tag;
      11  } Object;
      12  
      13  extern Object Make_Flonum (double);
      14  extern Object P_Pow (Object, Object);
      15  
      16  Object General_Function (Object x, Object y, double (*fun)()) {
      17    double d, ret;
      18  
      19    d = 1.0;
      20  
      21    if (y.tag >> 1)
      22      ret = (*fun) (d);
      23    else
      24      ret = (*fun) (d, 0.0);
      25  
      26    return Make_Flonum (ret);
      27  }
      28  
      29  Object P_Pow (Object x, Object y) { return General_Function (x, y, pow); }