1 /* PR 23572 : warnings for out of range floating-point constants. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c99" } */
4 /* { dg-skip-if "No Inf support" { spu-*-* } } */
8 #define INFINITY (__builtin_inff ())
13 float f1
= 3.5E+38f
; /* { dg-warning "floating constant exceeds range" } */
14 float f2
= -3.5E+38f
; /* { dg-warning "floating constant exceeds range" } */
18 double d1
= 1.9E+308; /* { dg-warning "floating constant exceeds range" } */
19 double d2
= -1.9E+308; /* { dg-warning "floating constant exceeds range" } */
21 double d4
= -INFINITY
;
26 float f11
= 3.3E-10000000000000000000f
; /* { dg-warning "floating constant truncated to zero" } */
27 float f22
= -3.3E-10000000000000000000f
; /* { dg-warning "floating constant truncated to zero" } */
28 float f1
= 3.3E-46f
; /* { dg-warning "floating constant truncated to zero" } */
29 float f2
= -3.3E-46f
; /* { dg-warning "floating constant truncated to zero" } */
35 double d11
= 3.3E-10000000000000000000; /* { dg-warning "floating constant truncated to zero" } */
36 double d22
= -3.3E-10000000000000000000; /* { dg-warning "floating constant truncated to zero" } */
37 double d1
= 1.4E-325; /* { dg-warning "floating constant truncated to zero" } */
38 double d2
= -1.4E-325; /* { dg-warning "floating constant truncated to zero" } */