[PATCH] [Asan] Fix the tsd_dtor_leak.cc test to pass on FreeBSD

Phabricator reviews at reviews.llvm.org
Fri Dec 12 04:10:36 PST 2014


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6590

Files:
  compiler-rt/trunk/test/asan/TestCases/Posix/tsd_dtor_leak.cc

Index: compiler-rt/trunk/test/asan/TestCases/Posix/tsd_dtor_leak.cc
===================================================================
--- compiler-rt/trunk/test/asan/TestCases/Posix/tsd_dtor_leak.cc
+++ compiler-rt/trunk/test/asan/TestCases/Posix/tsd_dtor_leak.cc
@@ -34,6 +34,13 @@
     fprintf(stderr, "heap size: new: %zd old: %zd\n", new_heap_size, old_heap_size);
     if (old_heap_size)
       assert(old_heap_size == new_heap_size);
+#if defined(__FreeBSD__)
+    // On FreeBSD SYSCALL(sched_yielld) allocates some more space during the
+    // 2nd attempt.
+    if (i > 0)
+      old_heap_size = new_heap_size;
+#else
     old_heap_size = new_heap_size;
+#endif
   }
 }

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6590.17224.patch
Type: text/x-patch
Size: 680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141212/29f679be/attachment.bin>


More information about the llvm-commits mailing list