Index: test/asan/TestCases/alloca_constant_size.cc =================================================================== --- test/asan/TestCases/alloca_constant_size.cc +++ test/asan/TestCases/alloca_constant_size.cc @@ -4,10 +4,17 @@ // RUN: %run %t 1 2>&1 | FileCheck %s // RUN: %run %t 2 2>&1 | FileCheck %s -#include #include #include +// MSVC provides _alloca instead of alloca. +#if defined(_MSC_VER) && !defined(alloca) +# define alloca _alloca +#else +#include +#endif + + void f1_alloca() { char *dynamic_buffer = (char *)alloca(200); fprintf(stderr, "dynamic_buffer = %p\n", dynamic_buffer);