1 // RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t
2 // RUN: %clangxx_asan -O3 -mllvm -asan-instrument-dynamic-allocas %s -o %t
6 #include "sanitizer/asan_interface.h"
10 __attribute__((noinline
)) void foo(int index
, int len
) {
11 volatile char str
[len
] __attribute__((aligned(32)));
12 assert(!(reinterpret_cast<uintptr_t>(str
) & 31L));
13 char *q
= (char *)__asan_region_is_poisoned((char *)str
, 64);
14 assert(q
&& ((q
- str
) == index
));
17 int main(int argc
, char **argv
) {
18 for (int i
= 1; i
< 33; ++i
)
21 for (int i
= 1; i
< 33; ++i
)