OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [dfp/] [Wconversion-2.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test messages for -Wconversion (based on gcc.dg/Wconversion-2.c).  */
2
/* { dg-do compile } */
3
/* { dg-options "-std=gnu99 -Wconversion" } */
4
 
5
void fsi(signed int);
6
void fd32(_Decimal32);
7
void fd64(_Decimal64);
8
void fd128(_Decimal128);
9
 
10
struct s {
11
  void (*fsi)(signed int);
12
  void (*fd32)(_Decimal32);
13
  void (*fd64)(_Decimal64);
14
  void (*fd128)(_Decimal128);
15
} x;
16
 
17
signed int si;
18
unsigned int ui;
19
_Decimal32 d32;
20
_Decimal64 d64;
21
_Decimal128 d128;
22
 
23
void
24
g (void)
25
{
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" } */
44
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.