1 // RUN: %clang_analyze_cc1 \
2 // RUN: -analyzer-checker=cplusplus.NewDelete,unix.Malloc \
3 // RUN: -analyzer-config add-pop-up-notes=false \
4 // RUN: -analyzer-output=text -verify %s
5 // RUN: %clang_analyze_cc1 \
6 // RUN: -analyzer-checker=cplusplus.NewDelete,unix.Malloc \
7 // RUN: -analyzer-config add-pop-up-notes=false \
8 // RUN: -analyzer-output=plist %s -o %t.plist
9 // RUN: %normalize_plist <%t.plist | diff -ub \
10 // RUN: %S/Inputs/expected-plists/NewDelete-path-notes.cpp.plist -
14 // expected-note@-1 {{Memory is allocated}}
15 if (p
) // expected-note {{Taking true branch}}
17 // expected-note@-1 {{Memory is released}}
19 delete p
; // expected-warning {{Attempt to free released memory}}
20 // expected-note@-1 {{Attempt to free released memory}}
25 delete this; // expected-note {{Memory is released}}
30 odd
->kill(); // expected-note{{Calling 'Odd::kill'}}
31 // expected-note@-1 {{Returning; memory was released}}
32 delete odd
; // expected-warning {{Attempt to free released memory}}
33 // expected-note@-1 {{Attempt to free released memory}}