1*673dc3d4SNico Weber // RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t
2*673dc3d4SNico Weber // RUN: %run %t 2>&1
3*673dc3d4SNico Weber //
4*673dc3d4SNico Weber 
5*673dc3d4SNico Weber #include <assert.h>
6*673dc3d4SNico Weber 
foo(int index,int len)7*673dc3d4SNico Weber __attribute__((noinline)) void foo(int index, int len) {
8*673dc3d4SNico Weber   volatile char str[len] __attribute__((aligned(32)));
9*673dc3d4SNico Weber   assert(!(reinterpret_cast<long>(str) & 31L));
10*673dc3d4SNico Weber   str[index] = '1';
11*673dc3d4SNico Weber }
12*673dc3d4SNico Weber 
main(int argc,char ** argv)13*673dc3d4SNico Weber int main(int argc, char **argv) {
14*673dc3d4SNico Weber   foo(4, 5);
15*673dc3d4SNico Weber   foo(39, 40);
16*673dc3d4SNico Weber   return 0;
17*673dc3d4SNico Weber }
18