1 /* { dg-do compile { target { ilp32 || lp64 } } } */
2 /* { dg-options "-Wsign-compare" } */
7 return (unsigned short) (~(unsigned short) x
) == 0; /* { dg-warning "promoted bitwise complement of an unsigned value is always nonzero" "" { target c } } */
13 return (unsigned short) (~(unsigned short) x
) == 5; /* { dg-warning "comparison of promoted bitwise complement of an unsigned value with constant" "" { target c } } */
19 return (unsigned int) (~(unsigned short) x
) == 0xffff0005U
; /* { dg-warning "comparison of promoted bitwise complement of an unsigned value with constant" } */
25 return (unsigned int) (~(unsigned short) x
) == 0xffff0005ULL
; /* { dg-warning "comparison of promoted bitwise complement of an unsigned value with constant" } */
31 return (unsigned int) (~(unsigned short) x
) == 0xffffff05U
; /* { dg-bogus "comparison of promoted bitwise complement of an unsigned value with constant" } */
37 return (unsigned int) (~(unsigned short) x
) == 0xffffff05ULL
; /* { dg-bogus "comparison of promoted bitwise complement of an unsigned value with constant" } */
43 return (unsigned long long) (~(unsigned short) x
) == 0xffffffffffffff05ULL
; /* { dg-bogus "comparison of promoted bitwise complement of an unsigned value with constant" } */
46 typedef unsigned short T
;
51 return (unsigned short) (~(unsigned short) x
) == 0; /* { dg-bogus "promoted bitwise complement of an unsigned value is always nonzero" } */
57 return (unsigned short) (~(unsigned short) x
) == 5; /* { dg-bogus "comparison of promoted bitwise complement of an unsigned value with constant" } */
61 f10 (T x
, unsigned char y
)
63 return (unsigned short) (~(unsigned short) x
) == y
; /* { dg-bogus "comparison of promoted bitwise complement of an unsigned value with unsigned" } */
67 f11 (T x
, unsigned char y
)
69 return (unsigned short) (~(unsigned short) x
) == y
; /* { dg-bogus "comparison of promoted bitwise complement of an unsigned value with unsigned" } */
73 f12 (unsigned char x
, unsigned char y
)
75 return (unsigned short) (~(unsigned short) x
) == y
; /* { dg-warning "comparison of promoted bitwise complement of an unsigned value with unsigned" "" { target c } } */
79 f13 (unsigned char x
, unsigned char y
)
81 return (unsigned short) (~(unsigned short) x
) == y
; /* { dg-warning "comparison of promoted bitwise complement of an unsigned value with unsigned" "" { target c } } */
85 f14 (unsigned char x
, unsigned int y
)
87 return (unsigned long long) (~x
) == y
; /* { dg-warning "comparison of promoted bitwise complement of an unsigned value with unsigned" } */
91 f15 (unsigned short x
, unsigned int y
)
93 return (long long) (~x
) == y
; /* { dg-warning "comparison of promoted bitwise complement of an unsigned value with unsigned" } */
97 f16 (unsigned char x
, unsigned short y
)
99 return (unsigned short) (~(unsigned short) x
) == y
; /* { dg-bogus "comparison of promoted bitwise complement of an unsigned value with unsigned" } */
103 f17 (unsigned char x
, unsigned short y
)
105 return (unsigned short) (~(unsigned short) x
) == y
; /* { dg-bogus "comparison of promoted bitwise complement of an unsigned value with unsigned" } */
109 f18 (unsigned char x
)
111 return (unsigned int) (short) (~(unsigned short) x
) == 0xffffff05ULL
; /* { dg-bogus "comparison of promoted bitwise complement of an unsigned value with constant" } */