2 /* { dg-do compile } */
3 /* { dg-options "-Wsign-compare" } */
6 fn1 (signed int a
, unsigned int b
)
8 return a
< b
; /* { dg-warning "comparison of integer expressions of different signedness: 'int' and 'unsigned int'" } */
12 fn2 (signed int a
, unsigned int b
)
14 return b
< a
; /* { dg-warning "comparison of integer expressions of different signedness: 'unsigned int' and 'int'" } */
18 fn3 (signed long int a
, unsigned long int b
)
20 return b
< a
; /* { dg-warning "comparison of integer expressions of different signedness: 'long unsigned int' and 'long int'" } */
24 fn4 (signed short int a
, unsigned int b
)
26 return b
< a
; /* { dg-warning "comparison of integer expressions of different signedness: 'unsigned int' and 'short int'" } */
30 fn5 (unsigned int a
, signed int b
)
32 return a
< b
; /* { dg-warning "comparison of integer expressions of different signedness: 'unsigned int' and 'int'" } */