diff options
Diffstat (limited to 'test/Analysis/new.cpp')
-rw-r--r-- | test/Analysis/new.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Analysis/new.cpp b/test/Analysis/new.cpp new file mode 100644 index 0000000000..95bd966cb0 --- /dev/null +++ b/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 + } +} + |