summaryrefslogtreecommitdiff
path: root/test/Analysis/new.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/new.cpp')
-rw-r--r--test/Analysis/new.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Analysis/new.cpp b/test/Analysis/new.cpp
index fb77de22f127..fdd16da3dc19 100644
--- a/test/Analysis/new.cpp
+++ b/test/Analysis/new.cpp
@@ -74,6 +74,18 @@ void testScalarInitialization() {
}
+struct PtrWrapper {
+ int *x;
+
+ PtrWrapper(int *input) : x(input) {}
+};
+
+PtrWrapper *testNewInvalidation() {
+ // Ensure that we don't consider this a leak.
+ return new PtrWrapper(static_cast<int *>(malloc(4)));
+}
+
+
//--------------------------------
// Incorrectly-modelled behavior
//--------------------------------