PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / pr41779.c
blobc42a0f58a4b36da9b613240e2e3e27d15bf982ca
1 /* PR41779: Wconversion cannot see through 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 } */
8 float f1(float x, unsigned short y)
10 return x * y;
13 float f2(float x, short y)
15 return x * y;
18 float f3(float x, char y)
20 return x * y;
23 float f4(float x, unsigned char y)
25 return x * y;
28 float f5(float x, int y)
30 return x * y; /* { dg-warning "conversion" } */
33 double c1(float x, unsigned short y, int z)
35 return z ? x + x : y;
38 double c2(float x, short y, int z)
40 return z ? x + x : y;
43 double c3(float x, char y, int z)
45 return z ? x + x : y;
48 double c4(float x, unsigned char y, int z)
50 return z ? x + x : y;
53 double c5(float x, int y, int z)
55 return z ? x + x : y; /* { dg-warning "conversion" } */