2011-03-01 03:49:42 +08:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store region -verify %s
|
2010-04-20 13:48:57 +08:00
|
|
|
|
|
|
|
void f1() {
|
2010-04-21 10:22:25 +08:00
|
|
|
int *n = new int;
|
|
|
|
if (*n) { // expected-warning {{Branch condition evaluates to a garbage value}}
|
2010-04-20 13:48:57 +08:00
|
|
|
}
|
2010-04-21 10:22:25 +08:00
|
|
|
}
|
2010-04-20 13:48:57 +08:00
|
|
|
|
2010-04-21 10:22:25 +08:00
|
|
|
void f2() {
|
|
|
|
int *n = new int(3);
|
|
|
|
if (*n) { // no-warning
|
2010-04-20 13:48:57 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|