mips.h (ISA_HAS_DSP, [...]): New macros.
[official-gcc.git] / gcc / testsuite / gcc.dg / float-range-3.c
blob6a224e16de915de220ca4650a5624935f82bddde
1 /* PR 23572 : warnings for out of range floating-point constants. */
2 /* { dg-compile } */
3 /* { dg-options "-std=c99" } */
4 #include <math.h>
6 void overflow(void)
8 float f1 = 3.5E+38f; /* { dg-warning "floating constant exceeds range" } */
9 float f2 = -3.5E+38f; /* { dg-warning "floating constant exceeds range" } */
10 float f3 = FP_INFINITE;
11 float f4 = -FP_INFINITE;
13 double d1 = 1.9E+308; /* { dg-warning "floating constant exceeds range" } */
14 double d2 = -1.9E+308; /* { dg-warning "floating constant exceeds range" } */
15 double d3 = FP_INFINITE;
16 double d4 = -FP_INFINITE;
19 void underflow(void)
21 float f11 = 3.3E-10000000000000000000f; /* { dg-warning "floating constant truncated to zero" } */
22 float f22 = -3.3E-10000000000000000000f; /* { dg-warning "floating constant truncated to zero" } */
23 float f1 = 3.3E-46f; /* { dg-warning "floating constant truncated to zero" } */
24 float f2 = -3.3E-46f; /* { dg-warning "floating constant truncated to zero" } */
25 float f3 = 0;
26 float f4 = -0;
27 float f5 = 0.0;
28 float f6 = -0.0;
30 double d11 = 3.3E-10000000000000000000; /* { dg-warning "floating constant truncated to zero" } */
31 double d22 = -3.3E-10000000000000000000; /* { dg-warning "floating constant truncated to zero" } */
32 double d1 = 1.4E-325; /* { dg-warning "floating constant truncated to zero" } */
33 double d2 = -1.4E-325; /* { dg-warning "floating constant truncated to zero" } */
34 double d3 = 0;
35 double d4 = -0;
36 double d5 = 0.0;
37 double d6 = -0.0;