Disable gnat.dg/socket1.adb on hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / float-cast-overflow-4.c
blob48ad257c641005fd3be0de223234e264ac2d0ecd
1 /* { dg-do run { target { lp64 } } } */
2 /* { dg-options "-fsanitize=float-cast-overflow" } */
4 #include <limits.h>
5 #include "float-cast.h"
7 int
8 main (void)
10 const long double inf = __builtin_infl ();
11 const long double nan = __builtin_nanl ("");
12 volatile long double ld;
14 volatile int i;
15 ld = INT_MIN;
16 CHECK_BOUNDARY (i, ld);
17 ld = 0.0l;
18 CHECK_BOUNDARY (i, ld);
19 ld = INT_MAX;
20 CHECK_BOUNDARY (i, ld);
21 CHECK_NONNUMBERS (i);
23 volatile unsigned int u;
24 ld = UINT_MAX;
25 CHECK_BOUNDARY (u, ld);
26 ld = 0.0l;
27 CHECK_BOUNDARY (u, ld);
28 CHECK_NONNUMBERS (u);
30 return 0;
33 /* { dg-output " -2.14748e\\\+09 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
34 /* { dg-output "\[^\n\r]* -2.14748e\\\+09 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
35 /* { dg-output "\[^\n\r]* -2.14748e\\\+09 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
36 /* { dg-output "\[^\n\r]* 2.14748e\\\+09 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
37 /* { dg-output "\[^\n\r]* 2.14748e\\\+09 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
38 /* { dg-output "\[^\n\r]* 2.14748e\\\+09 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
39 /* { dg-output "\[^\n\r]* nan is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
40 /* { dg-output "\[^\n\r]* -?nan is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
41 /* { dg-output "\[^\n\r]* inf is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
42 /* { dg-output "\[^\n\r]* -inf is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
43 /* { dg-output "\[^\n\r]* 4.29497e\\\+09 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
44 /* { dg-output "\[^\n\r]* 4.29497e\\\+09 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
45 /* { dg-output "\[^\n\r]* 4.29497e\\\+09 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
46 /* { dg-output "\[^\n\r]* -5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
47 /* { dg-output "\[^\n\r]* -1.5 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
48 /* { dg-output "\[^\n\r]* -1 is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
49 /* { dg-output "\[^\n\r]* nan is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
50 /* { dg-output "\[^\n\r]* -?nan is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
51 /* { dg-output "\[^\n\r]* inf is outside the range of representable values of type\[^\n\r]*(\n|\r\n|\r)" } */
52 /* { dg-output "\[^\n\r]* -inf is outside the range of representable values of type" } */