brintos

brintos / llvm-project-archived public Read only

0
0
Text · 929 B · 9e7555d Raw
27 lines · c
1// RUN: %clang_cc1 %s -verify -fsyntax-only -Wno-logical-not-parentheses2 3void f(_Atomic(int) a, _Atomic(int) b) {4  if (a > b)      {} // no warning5  if (a < b)      {} // no warning6  if (a >= b)     {} // no warning7  if (a <= b)     {} // no warning8  if (a == b)     {} // no warning9  if (a != b)     {} // no warning10 11  if (a == 0) {} // no warning12  if (a > 0) {} // no warning13  if (a > 1) {} // no warning14  if (a > 2) {} // no warning15 16  if (!a > 0) {}  // no warning17  if (!a > 1)     {} // expected-warning {{comparison of constant 1 with boolean expression is always false}}18  if (!a > 2)     {} // expected-warning {{comparison of constant 2 with boolean expression is always false}}19  if (!a > b)     {} // no warning20  if (!a > -1)    {} // expected-warning {{comparison of constant -1 with boolean expression is always true}}21}22 23typedef _Atomic(int) Ty;24void PR23638(Ty *a) {25  if (*a == 1) {} // no warning26}27