1 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.ExprInspection -verify -std=c++98 -Wno-deprecated %s
2 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.ExprInspection -verify -std=c++11 -Wno-deprecated %s
3 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.ExprInspection -verify -std=c++14 -Wno-deprecated %s
5 extern void clang_analyzer_eval(bool);
7 void test_bool_value() {
10 clang_analyzer_eval(b
== 1); // expected-warning{{TRUE}}
15 clang_analyzer_eval(b
== 0); // expected-warning{{TRUE}}
20 clang_analyzer_eval(b
== 1); // expected-warning{{TRUE}}
25 clang_analyzer_eval(b
== 1); // expected-warning{{TRUE}}
31 clang_analyzer_eval(b
== 1); // expected-warning{{TRUE}}
37 clang_analyzer_eval(b
== 1); // expected-warning{{TRUE}}
41 void test_bool_increment() {
45 clang_analyzer_eval(b
); // expected-warning{{TRUE}}
51 clang_analyzer_eval(b
); // expected-warning{{TRUE}}
57 clang_analyzer_eval(b
); // expected-warning{{TRUE}}
63 clang_analyzer_eval(b
); // expected-warning{{TRUE}}
69 clang_analyzer_eval(b
); // expected-warning{{TRUE}}
76 clang_analyzer_eval(b
); // expected-warning{{TRUE}}
82 clang_analyzer_eval(b
); // expected-warning{{TRUE}}