Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / float-range-4.c
blob2ec38c43bf669b33a0f8626ec637b0181b1d5ce5
1 /* PR 23572 : warnings for out of range floating-point constants. */
2 /* { dg-compile } */
3 /* { dg-options "-Wno-overflow -std=c99" } */
4 #include <math.h>
6 #ifndef INFINITY
7 #define INFINITY (__builtin_inff ())
8 #endif
10 void overflow(void)
12 float f1 = 3.5E+38f;
13 float f2 = -3.5E+38f;
14 float f3 = INFINITY;
15 float f4 = -INFINITY;
17 double d1 = 1.9E+308;
18 double d2 = -1.9E+308;
19 double d3 = INFINITY;
20 double d4 = -INFINITY;
23 void underflow(void)
25 float f11 = 3.3E-10000000000000000000f;
26 float f22 = -3.3E-10000000000000000000f;
27 float f1 = 3.3E-46f;
28 float f2 = -3.3E-46f;
29 float f3 = 0;
30 float f4 = -0;
31 float f5 = 0.0;
32 float f6 = -0.0;
34 double d11 = 3.3E-10000000000000000000;
35 double d22 = -3.3E-10000000000000000000;
36 double d1 = 1.4E-325;
37 double d2 = -1.4E-325;
38 double d3 = 0;
39 double d4 = -0;
40 double d5 = 0.0;
41 double d6 = -0.0;