]> granicus.if.org Git - clang/commitdiff
[analyzer] Test added
authorAnton Yartsev <anton.yartsev@gmail.com>
Sat, 30 Mar 2013 01:22:45 +0000 (01:22 +0000)
committerAnton Yartsev <anton.yartsev@gmail.com>
Sat, 30 Mar 2013 01:22:45 +0000 (01:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178397 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/NewDelete-intersections.mm

index a61d31381be439ace6b36e07b1d8ee6b7a4db922..edd0786e687cb0cba862879f81611672843745e7 100644 (file)
@@ -5,7 +5,6 @@
 typedef __typeof__(sizeof(int)) size_t;
 extern "C" void *malloc(size_t);
 extern "C" void free(void *);
-//int *global;
 
 //----------------------------------------------------------------------------
 // Check for intersections with unix.Malloc and unix.MallocWithAnnotations 
@@ -27,6 +26,13 @@ void testMallocFreeNoWarn() {
   int *p3 = (int *)malloc(sizeof(int)); // no warn
 }
 
+void testDeleteMalloced() {
+  int *p = (int *)malloc(sizeof(int));
+  delete p; // no warn
+} 
+
+// FIXME: Pointer should escape
+
 //----- Test free standard new
 void testFreeOpNew() {
   void *p = operator new(0);