1 // RUN: %clang_analyze_cc1 -w -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-allocator-inlining=true -std=c++11 -verify -analyzer-config eagerly-assume=false %s
3 void clang_analyzer_eval(bool);
4 void clang_analyzer_warnIfReached();
12 void checkConstructorInlining() {
14 clang_analyzer_eval(s
->x
== 1); // expected-warning{{TRUE}}
17 void checkNewPODunit() {
19 clang_analyzer_eval(*i
== 0); // expected-warning{{The left operand of '==' is a garbage value [core.UndefinedBinaryOperatorResult]}}
24 clang_analyzer_eval(*j
== 0); // expected-warning{{TRUE}}
26 clang_analyzer_eval(*k
== 5); // expected-warning{{TRUE}}
29 void checkNewArray() {
32 // FIXME: Handle big array construction
33 clang_analyzer_eval(s
[0].x
== 1); // expected-warning{{UNKNOWN}}
34 clang_analyzer_eval(s
[1].x
== 1); // expected-warning{{UNKNOWN}}
37 clang_analyzer_eval(s
[0].x
== 1); // expected-warning{{TRUE}}
38 clang_analyzer_eval(s
[1].x
== 1); // expected-warning{{TRUE}}
47 clang_analyzer_warnIfReached(); // no-warning
52 void checkNullThis() {
53 NullS
*nulls
= new NullS(); // no-crash
54 NullS
*nulls2
= new NullS(0);