[PATCH] Add FreeBSD support to the address sanitizer's assign_large_valloc_to_global.cc test case

Viktor Kutuzov vkutuzov at accesssoftek.com
Tue Jul 15 11:28:14 PDT 2014


Hi kcc, samsonov,

On FreeBSD it is <unistd.h> that declares valloc().

http://reviews.llvm.org/D4525

Files:
  test/asan/TestCases/Posix/assign_large_valloc_to_global.cc

Index: test/asan/TestCases/Posix/assign_large_valloc_to_global.cc
===================================================================
--- test/asan/TestCases/Posix/assign_large_valloc_to_global.cc
+++ test/asan/TestCases/Posix/assign_large_valloc_to_global.cc
@@ -1,8 +1,9 @@
 // Make sure we don't report a leak nor hang.
 // RUN: %clangxx_asan -O3 %s -o %t && %run %t
 #include <stdlib.h>
-#ifndef __APPLE__
+#include <unistd.h>
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
 # include <malloc.h>
-#endif  // __APPLE__
+#endif  // !__APPLE__ && !__FreeBSD__
 int *p = (int*)valloc(1 << 20);
 int main() { }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4525.11457.patch
Type: text/x-patch
Size: 613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140715/fdb2de61/attachment.bin>


More information about the llvm-commits mailing list