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

Differential Revision: http://reviews.llvm.org/D6590

llvm-svn: 224116
This commit is contained in:
Viktor Kutuzov 2014-12-12 12:09:56 +00:00
parent 1a53996c31
commit df4dab69e2
1 changed files with 7 additions and 0 deletions

View File

@ -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
}
}