| 1 |
/* { dg-do run { target { { { i?86-*-* x86_64-*-* } && { ! { ia32 } } || { ia64-*-* } } } } } */ |
| 2 |
/* { dg-options "-fsanitize=float-cast-overflow" } */ |
| 3 |
|
| 4 |
#include <limits.h> |
| 5 |
#include "float-cast.h" |
| 6 |
|
| 7 |
int |
| 8 |
main (void) |
| 9 |
{ |
| 10 |
volatile __float80 f; |
| 11 |
|
| 12 |
volatile signed char s; |
| 13 |
f = SCHAR_MIN; |
| 14 |
CHECK_BOUNDARY (s, f); |
| 15 |
f = 0.0w; |
| 16 |
CHECK_BOUNDARY (s, f); |
| 17 |
f = SCHAR_MAX; |
| 18 |
CHECK_BOUNDARY (s, f); |
| 19 |
|
| 20 |
volatile unsigned char u; |
| 21 |
f = UCHAR_MAX; |
| 22 |
CHECK_BOUNDARY (u, f); |
| 23 |
f = 0.0w; |
| 24 |
CHECK_BOUNDARY (u, f); |
| 25 |
|
| 26 |
return 0; |
| 27 |
} |
| 28 |
|
| 29 |
/* { dg-output " -133 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 30 |
/* { dg-output "\[^\n\r]* -129.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 31 |
/* { dg-output "\[^\n\r]* -129 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 32 |
/* { dg-output "\[^\n\r]* 128 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 33 |
/* { dg-output "\[^\n\r]* 128.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 34 |
/* { dg-output "\[^\n\r]* 132 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 35 |
/* { dg-output "\[^\n\r]* 256 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 36 |
/* { dg-output "\[^\n\r]* 256.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 37 |
/* { dg-output "\[^\n\r]* 260 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 38 |
/* { dg-output "\[^\n\r]* -5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 39 |
/* { dg-output "\[^\n\r]* -1.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */ |
| 40 |
/* { dg-output "\[^\n\r]* -1 is outside the range of representable values of type" } */ |