summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/new.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-04-20 05:48:57 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-04-20 05:48:57 +0000
commit52c28fe61a6e58e158b360607ea76069a7a9ba60 (patch)
treea515eca186c007b54c91c2dfcd7a67095806ddaa /clang/test/Analysis/new.cpp
parent9cffdf133127eb3efd281cfff7e78755312da55f (diff)
downloadbcm5719-llvm-52c28fe61a6e58e158b360607ea76069a7a9ba60.tar.gz
bcm5719-llvm-52c28fe61a6e58e158b360607ea76069a7a9ba60.zip
Add test cases.
llvm-svn: 101878
Diffstat (limited to 'clang/test/Analysis/new.cpp')
-rw-r--r--clang/test/Analysis/new.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Analysis/new.cpp b/clang/test/Analysis/new.cpp
new file mode 100644
index 00000000000..95bd966cb02
--- /dev/null
+++ b/clang/test/Analysis/new.cpp
@@ -0,0 +1,12 @@
+// 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 *n2 = new int(3);
+ if (*n2) { // no-warning
+ }
+}
+
OpenPOWER on IntegriCloud