| 1 |
/* Excess precision tests. Test excess precision of constants. */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=standard" } */ |
| 4 |
|
| 5 |
#include <float.h> |
| 6 |
|
| 7 |
#ifdef __cplusplus |
| 8 |
extern "C" { |
| 9 |
#endif |
| 10 |
extern void abort (void); |
| 11 |
extern void exit (int); |
| 12 |
#ifdef __cplusplus |
| 13 |
} |
| 14 |
#endif |
| 15 |
|
| 16 |
volatile long double ldadd1 = 1.0l + 0x1.0p-30l; |
| 17 |
volatile long double ld11f = 1.1f; |
| 18 |
volatile long double ld11d = 1.1; |
| 19 |
volatile long double ld11 = 1.1; |
| 20 |
|
| 21 |
void |
| 22 |
test_const (void) |
| 23 |
{ |
| 24 |
if (1.0f + 0x1.0p-30f != ldadd1) |
| 25 |
abort (); |
| 26 |
if (ld11f != ld11) |
| 27 |
abort (); |
| 28 |
if (ld11d != ld11) |
| 29 |
abort (); |
| 30 |
if (1.1f != ld11) |
| 31 |
abort (); |
| 32 |
} |
| 33 |
|
| 34 |
int |
| 35 |
main (void) |
| 36 |
{ |
| 37 |
test_const (); |
| 38 |
exit (0); |
| 39 |
} |