[compiler-rt] r224116 - [Asan] Fix the tsd_dtor_leak.cc test to pass on FreeBSD

Viktor Kutuzov vkutuzov at accesssoftek.com
Fri Dec 12 04:09:56 PST 2014


Author: vkutuzov
Date: Fri Dec 12 06:09:56 2014
New Revision: 224116

URL: http://llvm.org/viewvc/llvm-project?rev=224116&view=rev
Log:
[Asan] Fix the tsd_dtor_leak.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D6590

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

Modified: compiler-rt/trunk/test/asan/TestCases/Posix/tsd_dtor_leak.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Posix/tsd_dtor_leak.cc?rev=224116&r1=224115&r2=224116&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Posix/tsd_dtor_leak.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Posix/tsd_dtor_leak.cc Fri Dec 12 06:09:56 2014
@@ -34,6 +34,13 @@ int main() {
     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
   }
 }





More information about the llvm-commits mailing list