2010-04-20 13:48:57 +08:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store region -verify %s
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|