diff options
Diffstat (limited to 'clang/test/Analysis/NewDelete-path-notes.cpp')
-rw-r--r-- | clang/test/Analysis/NewDelete-path-notes.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/clang/test/Analysis/NewDelete-path-notes.cpp b/clang/test/Analysis/NewDelete-path-notes.cpp index 70fd973facf..d556947507e 100644 --- a/clang/test/Analysis/NewDelete-path-notes.cpp +++ b/clang/test/Analysis/NewDelete-path-notes.cpp @@ -1,13 +1,23 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=text -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=text -analyzer-config c++-allocator-inlining=true -verify %s -// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=plist %s -o %t.plist -// RUN: cat %t.plist | %diff_plist %S/Inputs/expected-plists/NewDelete-path-notes.cpp.plist - +// RUN: %clang_analyze_cc1 \ +// RUN: -analyzer-checker=cplusplus.NewDelete,unix.Malloc \ +// RUN: -analyzer-config add-pop-up-notes=false \ +// RUN: -analyzer-output=text -verify %s +// RUN: %clang_analyze_cc1 \ +// RUN: -analyzer-checker=cplusplus.NewDelete,unix.Malloc \ +// RUN: -analyzer-config c++-allocator-inlining=true \ +// RUN: -analyzer-config add-pop-up-notes=false \ +// RUN: -analyzer-output=text -verify %s +// RUN: %clang_analyze_cc1 \ +// RUN: -analyzer-checker=cplusplus.NewDelete,unix.Malloc \ +// RUN: -analyzer-config add-pop-up-notes=false \ +// RUN: -analyzer-output=plist %s -o %t.plist +// RUN: cat %t.plist | %diff_plist \ +// RUN: %S/Inputs/expected-plists/NewDelete-path-notes.cpp.plist - void test() { int *p = new int; // expected-note@-1 {{Memory is allocated}} - if (p) // expected-note {{'p' is non-null}} - // expected-note@-1 {{Taking true branch}} + if (p) // expected-note {{Taking true branch}} delete p; // expected-note@-1 {{Memory is released}} |