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 // In this test we check whether the solver's symbol simplification mechanism
8 // is capable of re-assuming simiplified symbols.
10 void clang_analyzer_eval(bool);
11 void clang_analyzer_warnIfReached();
13 void test_reassume_false_range(int x
, int y
) {
14 if (x
+ y
!= 0) // x + y == 0
18 clang_analyzer_eval(y
== -1); // expected-warning{{TRUE}}
21 void test_reassume_true_range(int x
, int y
) {
22 if (x
+ y
!= 1) // x + y == 1
26 clang_analyzer_eval(y
== 0); // expected-warning{{TRUE}}
29 void test_reassume_inclusive_range(int x
, int y
) {
30 if (x
+ y
< 0 || x
+ y
> 1) // x + y: [0, 1]
35 clang_analyzer_eval(y
> 0); // expected-warning{{FALSE}}
36 clang_analyzer_eval(y
< -1);// expected-warning{{FALSE}}