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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [c-c++-common/] [pr41779.c] - Blame information for rev 686

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 686 jeremybenn
/* PR41779: Wconversion cannot see throught real*integer promotions. */
2
/* { dg-do compile } */
3
/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */
4
/* { dg-options "-std=c99 -Wconversion" { target c } } */
5
/* { dg-options "-Wconversion" { target c++ } } */
6
/* { dg-require-effective-target large_double } */
7
 
8
float f1(float x, unsigned short y)
9
{
10
  return x * y;
11
}
12
 
13
float f2(float x, short y)
14
{
15
  return x * y;
16
}
17
 
18
float f3(float x, char y)
19
{
20
  return x * y;
21
}
22
 
23
float f4(float x, unsigned char y)
24
{
25
  return x * y;
26
}
27
 
28
float f5(float x, int y)
29
{
30
  return x * y; /* { dg-warning "conversion" } */
31
}
32
 
33
double c1(float x, unsigned short y, int z)
34
{
35
  return z ? x + x : y;
36
}
37
 
38
double c2(float x, short y, int z)
39
{
40
  return z ? x + x : y;
41
}
42
 
43
double c3(float x, char y, int z)
44
{
45
  return z ? x + x : y;
46
}
47
 
48
double c4(float x, unsigned char y, int z)
49
{
50
  return z ? x + x : y;
51
}
52
 
53
double c5(float x, int y, int z)
54
{
55
  return z ? x + x : y; /* { dg-warning "conversion" } */
56
}

powered by: WebSVN 2.1.0

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