Fix tests that break unnecessarily for avr.
[gcc.git] / gcc / testsuite / gcc.dg / pr59963-2.c
1 /* PR c/59963 */
2 /* { dg-do compile } */
3 /* { dg-options "-Woverflow -Wconversion" } */
4 /* { dg-require-effective-target int32plus } */
5
6 extern void bar (unsigned char);
7 extern void bar8 (unsigned char, unsigned char, unsigned char, unsigned char,
8 unsigned char, unsigned char, unsigned char, unsigned char);
9 extern void bazu (unsigned int, ...);
10 extern void bazi (char, int);
11 extern int f (short a, short b);
12
13 int
14 g (void)
15 {
16 return f (0xffffffffL, /* { dg-warning "13:overflow in implicit constant conversion" } */
17 0xffffffffL) /* { dg-warning "13:overflow in implicit constant conversion" } */
18 && f (0xffffffffL, /* { dg-warning "9:overflow in implicit constant conversion" } */
19 0xffffffffL); /* { dg-warning "9:overflow in implicit constant conversion" } */
20 }
21
22 void
23 foo (int i)
24 {
25 bar (256); /* { dg-warning "8:large integer implicitly truncated to unsigned type" } */
26 bar (6.66f); /* { dg-warning "8:conversion" } */
27 bar8 (-1, /* { dg-warning "9:negative integer implicitly converted to unsigned type" } */
28 -2, /* { dg-warning "3:negative integer implicitly converted to unsigned type" } */
29 -3, /* { dg-warning "4:negative integer implicitly converted to unsigned type" } */
30 -4, /* { dg-warning "5:negative integer implicitly converted to unsigned type" } */
31 -5, /* { dg-warning "6:negative integer implicitly converted to unsigned type" } */
32 -6, /* { dg-warning "7:negative integer implicitly converted to unsigned type" } */
33 -7, /* { dg-warning "8:negative integer implicitly converted to unsigned type" } */
34 -8); /* { dg-warning "9:negative integer implicitly converted to unsigned type" } */
35 bazu (i, i); /* { dg-warning "9:conversion" } */
36 bazi (0x8, 0x80000000); /* { dg-warning "14:conversion of unsigned constant value to negative integer" "" { xfail int16 } } */
37 }