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