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" } */
6 /* { dg-require-effective-target large_double } */
10 long double vlongdouble
;
12 void ffloat (float f
);
13 void fdouble (double d
);
14 void flongdouble (long double ld
);
22 ffloat (3.1); /* { dg-warning "conversion" } */
23 vfloat
= 3.1; /* { dg-warning "conversion" } */
24 ffloat (3.1L); /* { dg-warning "conversion" } */
25 vfloat
= 3.1L; /* { dg-warning "conversion" } */
26 fdouble (3.1L); /* { dg-warning "conversion" "" { target large_long_double } } */
27 vdouble
= 3.1L; /* { dg-warning "conversion" "" { target large_long_double } } */
28 ffloat (vdouble
); /* { dg-warning "conversion" } */
29 vfloat
= vdouble
; /* { dg-warning "conversion" } */
30 ffloat (vlongdouble
); /* { dg-warning "conversion" } */
31 vfloat
= vlongdouble
; /* { dg-warning "conversion" } */
32 fdouble (vlongdouble
); /* { dg-warning "conversion" "" { target large_long_double } } */
33 vdouble
= vlongdouble
; /* { dg-warning "conversion" "" { target large_long_double } } */
38 ffloat ((float) 3.1L);
39 vfloat
= (float) 3.1L;
40 fdouble ((double) 3.1L);
41 vdouble
= (double) 3.1L;
42 ffloat ((float) vdouble
);
43 vfloat
= (float) vdouble
;
44 ffloat ((float) vlongdouble
);
45 vfloat
= (float) vlongdouble
;
46 fdouble ((double) vlongdouble
);
47 vdouble
= (double) vlongdouble
;