diff options
Diffstat (limited to 'test/Sema/compare.c')
-rw-r--r-- | test/Sema/compare.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Sema/compare.c b/test/Sema/compare.c index 2821a935c3..7c8c36f0c1 100644 --- a/test/Sema/compare.c +++ b/test/Sema/compare.c @@ -274,3 +274,11 @@ void test4() { if (value < (unsigned long) &ptr4) // expected-warning {{comparison of integers of different signs}} return; } + +// PR4807 +int test5(unsigned int x) { + return (x < 0) // expected-warning {{comparison of unsigned expression < 0 is always false}} + && (0 > x) // expected-warning {{comparison of 0 > unsigned expression is always false}} + && (x >= 0) // expected-warning {{comparison of unsigned expression >= 0 is always true}} + && (0 <= x); // expected-warning {{comparison of 0 <= unsigned expression is always true}} +} |