From 41d9b3640c3d7241846bb6a426228503f629da96 Mon Sep 17 00:00:00 2001
From: Dimitry Andric <dimitry@andric.com>
Date: Sun, 31 Jul 2016 20:16:59 +0000
Subject: [PATCH] Fix ASan alloca_constant_size.cc test on FreeBSD.

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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler-rt/test/asan/TestCases/alloca_constant_size.cc b/compiler-rt/test/asan/TestCases/alloca_constant_size.cc
index 61f6da710116..a766ae75be07 100644
--- a/compiler-rt/test/asan/TestCases/alloca_constant_size.cc
+++ b/compiler-rt/test/asan/TestCases/alloca_constant_size.cc
@@ -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