view gcc/testsuite/gcc.dg/torture/pr70457.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */

/* This formerly ICEd when trying to expand pow as a built-in with
   the wrong number of arguments.  */

extern double pow (double, double) __attribute__ ((__nothrow__ , __leaf__));

typedef struct {
  long long data;
  int tag;
} Object;

extern Object Make_Flonum (double);
extern Object P_Pow (Object, Object);

Object General_Function (Object x, Object y, double (*fun)()) {
  double d, ret;

  d = 1.0;

  if (y.tag >> 1)
    ret = (*fun) (d);
  else
    ret = (*fun) (d, 0.0);

  return Make_Flonum (ret);
}

Object P_Pow (Object x, Object y) { return General_Function (x, y, pow); }