Merge from mainline
[official-gcc.git] / gcc / testsuite / gcc.dg / dfp / Wconversion-2.c
blobafc0b4dab2b60992228258a3ffadb8fd406fd0c5
1 /* Test messages for -Wconversion (based on gcc.dg/Wconversion-2.c). */
2 /* { dg-do compile } */
3 /* { dg-options "-std=gnu99 -Wconversion" } */
5 void fsi(signed int);
6 void fd32(_Decimal32);
7 void fd64(_Decimal64);
8 void fd128(_Decimal128);
10 struct s {
11 void (*fsi)(signed int);
12 void (*fd32)(_Decimal32);
13 void (*fd64)(_Decimal64);
14 void (*fd128)(_Decimal128);
15 } x;
17 signed int si;
18 unsigned int ui;
19 _Decimal32 d32;
20 _Decimal64 d64;
21 _Decimal128 d128;
23 void
24 g (void)
26 fsi(d32); /* { dg-warning "warning: passing argument 1 of 'fsi' as integer rather than floating due to prototype" } */
27 x.fsi(d32); /* { dg-warning "warning: passing argument 1 of 'x.fsi' as integer rather than floating due to prototype" } */
28 fsi(d64); /* { dg-warning "warning: passing argument 1 of 'fsi' as integer rather than floating due to prototype" } */
29 x.fsi(d64); /* { dg-warning "warning: passing argument 1 of 'x.fsi' as integer rather than floating due to prototype" } */
30 fsi(d128); /* { dg-warning "warning: passing argument 1 of 'fsi' as integer rather than floating due to prototype" } */
31 x.fsi(d128); /* { dg-warning "warning: passing argument 1 of 'x.fsi' as integer rather than floating due to prototype" } */
32 fd32(si); /* { dg-warning "warning: passing argument 1 of 'fd32' as floating rather than integer due to prototype" } */
33 x.fd32(si); /* { dg-warning "warning: passing argument 1 of 'x.fd32' as floating rather than integer due to prototype" } */
34 fd64(ui); /* { dg-warning "warning: passing argument 1 of 'fd64' as floating rather than integer due to prototype" } */
35 x.fd64(ui); /* { dg-warning "warning: passing argument 1 of 'x.fd64' as floating rather than integer due to prototype" } */
36 fd128(si); /* { dg-warning "warning: passing argument 1 of 'fd128' as floating rather than integer due to prototype" } */
37 x.fd128(ui); /* { dg-warning "warning: passing argument 1 of 'x.fd128' as floating rather than integer due to prototype" } */
38 fd32(1.0); /* { dg-warning "warning: passing argument 1 of 'fd32' as '_Decimal32' rather than 'double' due to prototype" } */
39 x.fd32(1.0); /* { dg-warning "warning: passing argument 1 of 'x.fd32' as '_Decimal32' rather than 'double' due to prototype" } */
40 fd64(1.0); /* { dg-warning "warning: passing argument 1 of 'fd64' as '_Decimal64' rather than 'double' due to prototype" } */
41 x.fd64(1.0); /* { dg-warning "warning: passing argument 1 of 'x.fd64' as '_Decimal64' rather than 'double' due to prototype" } */
42 fd128(1.0); /* { dg-warning "warning: passing argument 1 of 'fd128' as '_Decimal128' rather than 'double' due to prototype" } */
43 x.fd128(1.0); /* { dg-warning "warning: passing argument 1 of 'x.fd128' as '_Decimal128' rather than 'double' due to prototype" } */