Fix ASan alloca_constant_size.cc test on FreeBSD.
authorDimitry Andric <dimitry@andric.com>
Sun, 31 Jul 2016 20:16:59 +0000 (20:16 +0000)
committerDimitry Andric <dimitry@andric.com>
Sun, 31 Jul 2016 20:16:59 +0000 (20:16 +0000)
On FreeBSD <alloca.h> does not exist: alloca(3) is defined in <stdlib.h>
instead.

llvm-svn: 277300

compiler-rt/test/asan/TestCases/alloca_constant_size.cc

index 61f6da7..a766ae7 100644 (file)
@@ -10,6 +10,8 @@
 // MSVC provides _alloca instead of alloca.
 #if defined(_MSC_VER) && !defined(alloca)
 # define alloca _alloca
+#elif defined(__FreeBSD__)
+#include <stdlib.h>
 #else
 #include <alloca.h>
 #endif