| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-fno-inline -Os" } */ |
| 3 |
/* { dg-skip-if "long double support is incomplete" { "avr-*-*" } } */ |
| 4 |
|
| 5 |
void abort(void); |
| 6 |
|
| 7 |
|
| 8 |
float powif(float x, int n) |
| 9 |
{ |
| 10 |
return __builtin_powif(x, n); |
| 11 |
} |
| 12 |
|
| 13 |
double powi(double x, int n) |
| 14 |
{ |
| 15 |
return __builtin_powi(x, n); |
| 16 |
} |
| 17 |
|
| 18 |
long double powil(long double x, int n) |
| 19 |
{ |
| 20 |
return __builtin_powil(x, n); |
| 21 |
} |
| 22 |
|
| 23 |
|
| 24 |
float powcif(float x) |
| 25 |
{ |
| 26 |
return __builtin_powif(x, 5); |
| 27 |
} |
| 28 |
|
| 29 |
double powci(double x) |
| 30 |
{ |
| 31 |
return __builtin_powi(x, 5); |
| 32 |
} |
| 33 |
|
| 34 |
long double powcil(long double x) |
| 35 |
{ |
| 36 |
return __builtin_powil(x, 5); |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
float powicf(int n) |
| 41 |
{ |
| 42 |
return __builtin_powif(2.0, n); |
| 43 |
} |
| 44 |
|
| 45 |
double powic(int n) |
| 46 |
{ |
| 47 |
return __builtin_powi(2.0, n); |
| 48 |
} |
| 49 |
|
| 50 |
long double powicl(int n) |
| 51 |
{ |
| 52 |
return __builtin_powil(2.0, n); |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
int main() |
| 57 |
{ |
| 58 |
if (__builtin_powi(1.0, 5) != 1.0) |
| 59 |
abort(); |
| 60 |
if (__builtin_powif(1.0, 5) != 1.0) |
| 61 |
abort(); |
| 62 |
if (__builtin_powil(1.0, 5) != 1.0) |
| 63 |
abort(); |
| 64 |
if (powci(1.0) != 1.0) |
| 65 |
abort(); |
| 66 |
if (powcif(1.0) != 1.0) |
| 67 |
abort(); |
| 68 |
if (powcil(1.0) != 1.0) |
| 69 |
abort(); |
| 70 |
if (powi(1.0, -5) != 1.0) |
| 71 |
abort(); |
| 72 |
if (powif(1.0, -5) != 1.0) |
| 73 |
abort(); |
| 74 |
if (powil(1.0, -5) != 1.0) |
| 75 |
abort(); |
| 76 |
if (powic(1) != 2.0) |
| 77 |
abort(); |
| 78 |
if (powicf(1) != 2.0) |
| 79 |
abort(); |
| 80 |
if (powicl(1) != 2.0) |
| 81 |
abort(); |
| 82 |
return 0; |
| 83 |
} |