1 /* Test for diagnostics for Wconversion for floating-point. */
3 /* { dg-do compile } */
4 /* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */
5 /* { dg-options "-std=c99 -Wconversion" { target c } } */
6 /* { dg-options "-Wconversion" { target c++ } } */
7 /* { dg-require-effective-target large_double } */
11 long double vlongdouble
;
13 void ffloat (float f
);
14 void fdouble (double d
);
15 void flongdouble (long double ld
);
23 ffloat (3.1); /* { dg-warning "conversion" } */
24 vfloat
= 3.1; /* { dg-warning "conversion" } */
25 ffloat (3.1L); /* { dg-warning "conversion" } */
26 vfloat
= 3.1L; /* { dg-warning "conversion" } */
27 fdouble (3.1L); /* { dg-warning "conversion" "" { target large_long_double } } */
28 vdouble
= 3.1L; /* { dg-warning "conversion" "" { target large_long_double } } */
29 ffloat (vdouble
); /* { dg-warning "conversion" } */
30 vfloat
= vdouble
; /* { dg-warning "conversion" } */
31 ffloat (vlongdouble
); /* { dg-warning "conversion" } */
32 vfloat
= vlongdouble
; /* { dg-warning "conversion" } */
33 fdouble (vlongdouble
); /* { dg-warning "conversion" "" { target large_long_double } } */
34 vdouble
= vlongdouble
; /* { dg-warning "conversion" "" { target large_long_double } } */
39 ffloat ((float) 3.1L);
40 vfloat
= (float) 3.1L;
41 fdouble ((double) 3.1L);
42 vdouble
= (double) 3.1L;
43 ffloat ((float) vdouble
);
44 vfloat
= (float) vdouble
;
45 ffloat ((float) vlongdouble
);
46 vfloat
= (float) vlongdouble
;
47 fdouble ((double) vlongdouble
);
48 vdouble
= (double) vlongdouble
;