1 // RUN: %clang_analyze_cc1 %s \
2 // RUN: -analyzer-checker=core \
3 // RUN: -analyzer-checker=debug.ExprInspection \
4 // RUN: -analyzer-config eagerly-assume=false \
7 // Here we test whether the SValBuilder is capable to simplify existing
8 // SVals based on a newly added constraints when evaluating a BinOp.
10 void clang_analyzer_eval(bool);
12 void test_evalBinOp_simplifies_lhs(int y
) {
17 // Below `x` is the LHS being simplified.
18 clang_analyzer_eval(x
== 1); // expected-warning{{TRUE}}
22 void test_evalBinOp_simplifies_rhs(int y
) {
27 // Below `x` is the RHS being simplified.
28 clang_analyzer_eval(1 == x
); // expected-warning{{TRUE}}