| 1 |
/* { dg-do run { target { ! avr_tiny } } } */ |
| 2 |
/* { dg-additional-options "-Os" } */ |
| 3 |
|
| 4 |
const long double vals[] = |
| 5 |
{ |
| 6 |
0.0625L, -0.125L, 0.25L, -0.5L, |
| 7 |
1.0L, |
| 8 |
-2.0L, 4.0L, -8.0L, 16.0L |
| 9 |
}; |
| 10 |
|
| 11 |
#define ARRAY_SIZE(X) ((int) (sizeof(X) / sizeof(*X))) |
| 12 |
|
| 13 |
__attribute__((noipa)) |
| 14 |
void test1 (long double x) |
| 15 |
{ |
| 16 |
int i; |
| 17 |
|
| 18 |
for (i = 0; i < ARRAY_SIZE (vals); ++i) |
| 19 |
{ |
| 20 |
long double val0 = vals[i]; |
| 21 |
long double val1 = __builtin_powil (x, i - 4); |
| 22 |
__asm ("" : "+r" (val0)); |
| 23 |
|
| 24 |
if (val0 != val1) |
| 25 |
__builtin_exit (__LINE__); |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
int main (void) |
| 30 |
{ |
| 31 |
test1 (-2.0L); |
| 32 |
return 0; |
| 33 |
} |