1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -std=c++17 -verify %s
3 void clang_analyzer_eval(bool);
15 int x
= i
; // expected-warning{{Assigned value is garbage or undefined}}
24 clang_analyzer_eval(i
== 1); // expected-warning{{TRUE}}
25 int y
= j
; // expected-warning{{Assigned value is garbage or undefined}}
33 int x
= i
; // expected-warning{{Assigned value is garbage or undefined}}
42 clang_analyzer_eval(i
== 1); // expected-warning{{TRUE}}
44 clang_analyzer_eval(tst
.a
== 2); // expected-warning{{TRUE}}
46 int y
= j
; // expected-warning{{Assigned value is garbage or undefined}}
55 clang_analyzer_eval(i
== 1); // expected-warning{{TRUE}}
58 clang_analyzer_eval(j
== 2); // expected-warning{{TRUE}}
66 int x
= i
; // expected-warning{{Assigned value is garbage or undefined}}
75 clang_analyzer_eval(i
== 1); // expected-warning{{TRUE}}
76 int y
= j
; // expected-warning{{Assigned value is garbage or undefined}}
92 clang_analyzer_eval(tst
.y
.a
== 1); // expected-warning{{TRUE}}
96 // FIXME: These should be undefined, but we have to fix
97 // reading undefined from lazy compound values first.
98 clang_analyzer_eval(i
.a
); // expected-warning{{UNKNOWN}}
99 clang_analyzer_eval(i
.b
); // expected-warning{{UNKNOWN}}
101 clang_analyzer_eval(j
.a
== 1); // expected-warning{{TRUE}}
102 clang_analyzer_eval(j
.b
== 2); // expected-warning{{TRUE}}
108 clang_analyzer_eval(tst
.y
.a
== 1); // expected-warning{{TRUE}}
113 clang_analyzer_eval(tst
.y
.a
== 3); // expected-warning{{TRUE}}
114 clang_analyzer_eval(tst
.y
.b
== 2); // expected-warning{{TRUE}}
115 clang_analyzer_eval(j
.b
== 2); // expected-warning{{TRUE}}