1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s
11 void clang_analyzer_eval(int);
14 // In main() we know that the initial values are still valid.
15 clang_analyzer_eval(x
== 1); // expected-warning{{TRUE}}
16 clang_analyzer_eval(s
.a
== 2); // expected-warning{{TRUE}}
17 clang_analyzer_eval(s
.b
== 3); // expected-warning{{TRUE}}
18 clang_analyzer_eval(arr
[0] == 4); // expected-warning{{TRUE}}
19 clang_analyzer_eval(arr
[1] == 5); // expected-warning{{TRUE}}
20 clang_analyzer_eval(arr
[2] == 6); // expected-warning{{TRUE}}
25 // In other functions these values may already be overwritten.
26 clang_analyzer_eval(x
== 1); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
27 clang_analyzer_eval(s
.a
== 2); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
28 clang_analyzer_eval(s
.b
== 3); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
29 clang_analyzer_eval(arr
[0] == 4); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
30 clang_analyzer_eval(arr
[1] == 5); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
31 clang_analyzer_eval(arr
[2] == 6); // expected-warning{{TRUE}} // expected-warning{{FALSE}}