diff options
-rw-r--r-- | test/Analysis/new.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/Analysis/new.cpp b/test/Analysis/new.cpp index 95bd966cb0..f26eecd4b1 100644 --- a/test/Analysis/new.cpp +++ b/test/Analysis/new.cpp @@ -1,12 +1,14 @@ // RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store region -verify %s void f1() { - int *n1 = new int; - if (*n1) { // expected-warning {{Branch condition evaluates to a garbage value}} + int *n = new int; + if (*n) { // expected-warning {{Branch condition evaluates to a garbage value}} } +} - int *n2 = new int(3); - if (*n2) { // no-warning +void f2() { + int *n = new int(3); + if (*n) { // no-warning } } |