// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-logical-not-parentheses void f(int x, int y, int z) { int a,b; if ((a > 2) > 1) {} // expected-warning {{comparison of constant 1 with boolean expression is always false}} if (a > b) {} // no warning if (a < b) {} // no warning if (a >= b) {} // no warning if (a <= b) {} // no warning if (a == b) {} // no warning if (a != b) {} // no warning if (a > 0) {} // no warning if (a > 1) {} // no warning if (a > 2) {} // no warning if (a >= 0) {} // no warning if (a >= 1) {} // no warning if (a >= 2) {} // no warning if (a >= -1) {} // no warning if (a <= 0) {} // no warning if (a <= 1) {} // no warning if (a <= 2) {} // no warning if (a <= -1) {} // no warning if (!a > 0) {} // no warning if (!a > 1) {} // expected-warning {{comparison of constant 1 with boolean expression is always false}} if (!a > 2) {} // expected-warning {{comparison of constant 2 with boolean expression is always false}} if (!a > y) {} // no warning if (!a > b) {} // no warning if (!a > -1) {} // expected-warning {{comparison of constant -1 with boolean expression is always true}} if (!a < 0) {} // expected-warning {{comparison of constant 0 with boolean expression is always false}} if (!a < 1) {} // no warning if (!a < 2) {} // expected-warning {{comparison of constant 2 with boolean expression is always true}} if (!a < y) {} // no warning if (!a < b) {} // no warning if (!a < -1) {} // expected-warning {{comparison of constant -1 with boolean expression is always false}} if (!a >= 0) {} // expected-warning {{comparison of constant 0 with boolean expression is always true}} if (!a >= 1) {} // no warning if (!a >= 2) {} // expected-warning {{comparison of constant 2 with boolean expression is always false}} if (!a >= y) {} // no warning if (!a >= b) {} // no warning if (!a >= -1) {} // expected-warning {{comparison of constant -1 with boolean expression is always true}} if (!a <= 0) {} // no warning if (!a <= 1) {} // expected-warning {{comparison of constant 1 with boolean expression is always true}} if (!a <= 2) {} // expected-warning {{comparison of constant 2 with boolean expression is always true}} if (!a <= y) {} // no warning if (!a <= b) {} // no warning if (!a <= -1) {} // expected-warning {{comparison of constant -1 with boolean expression is always false}} if ((a||b) > 0) {} // no warning if ((a||b) > 1) {} // expected-warning {{comparison of constant 1 with boolean expression is always false}} if ((a||b) > 4) {} // expected-warning {{comparison of constant 4 with boolean expression is always false}} if ((a||b) > -1) {}// expected-warning {{comparison of constant -1 with boolean expression is always true}} if ((a&&b) > 0) {} // no warning if ((a&&b) > 1) {} // expected-warning {{comparison of constant 1 with boolean expression is always false}} if ((a&&b) > 4) {} // expected-warning {{comparison of constant 4 with boolean expression is always false}} if ((a 0) {} // no warning if ((a 1) {} // expected-warning {{comparison of constant 1 with boolean expression is always false}} if ((a 4) {} // expected-warning {{comparison of constant 4 with boolean expression is always false}} if ((a z) {} // no warning if ((a -1) {} // expected-warning {{comparison of constant -1 with boolean expression is always true}} if ((ay z) {} // no warning if((a(z !a) {} // expected-warning {{comparison of constant 0 with boolean expression is always false}} if (1 > !a) {} // no warning if (2 > !a) {} // expected-warning {{comparison of constant 2 with boolean expression is always true}} if (y > !a) {} // no warning if (-1 > !a) {} // expected-warning {{comparison of constant -1 with boolean expression is always false}} if (0 < !a) {} // no warning if (1 < !a) {} // expected-warning {{comparison of constant 1 with boolean expression is always false}} if (2 < !a) {} // expected-warning {{comparison of constant 2 with boolean expression is always false}} if (y < !a) {} // no warning if (-1 < !a) {} // expected-warning {{comparison of constant -1 with boolean expression is always true}} if (0 >= !a) {} // no warning if (1 >= !a) {} // expected-warning {{comparison of constant 1 with boolean expression is always true}} if (2 >= !a) {} // expected-warning {{comparison of constant 2 with boolean expression is always true}} if (y >= !a) {} // no warning if (-1 >= !a) {} // expected-warning {{comparison of constant -1 with boolean expression is always false}} if (0 <= !a) {} // expected-warning {{comparison of constant 0 with boolean expression is always true}} if (1 <= !a) {} // no warning if (2 <= !a) {} // expected-warning {{comparison of constant 2 with boolean expression is always false}} if (y <= !a) {} // no warning if (-1 <= !a) {} // expected-warning {{comparison of constant -1 with boolean expression is always true}} if (0 > (a||b)) {} // expected-warning {{comparison of constant 0 with boolean expression is always false}} if (1 > (a||b)) {} // no warning if (4 > (a||b)) {} // expected-warning {{comparison of constant 4 with boolean expression is always true}} if (0 > (a&&b)) {} // expected-warning {{comparison of constant 0 with boolean expression is always false}} if (1 > (a&&b)) {} // no warning if (4 > (a&&b)) {} // expected-warning {{comparison of constant 4 with boolean expression is always true}} if (0 > (a (a (a (a (ay) {} // no warning if (z > (a(a2))!=(a