]> granicus.if.org Git - clang/commitdiff
The second check point in the old test case was invalid.
authorZhongxing Xu <xuzhongxing@gmail.com>
Wed, 21 Apr 2010 02:22:25 +0000 (02:22 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Wed, 21 Apr 2010 02:22:25 +0000 (02:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101983 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/new.cpp

index 95bd966cb02bbf1ccef508fa05a671d932e9327d..f26eecd4b196a9a39946109f946118547371a961 100644 (file)
@@ -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
   }
 }