Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / alloca_safe_access.cpp
blob98e31769812bf959bf3039f49dd4bd6aa18b3620
1 // RUN: %clangxx_asan -O0 -mllvm -asan-instrument-dynamic-allocas %s -o %t
2 // RUN: %run %t 2>&1
3 //
5 #include <assert.h>
6 #include <stdint.h>
8 __attribute__((noinline)) void foo(int index, int len) {
9 volatile char str[len] __attribute__((aligned(32)));
10 assert(!(reinterpret_cast<uintptr_t>(str) & 31L));
11 str[index] = '1';
14 int main(int argc, char **argv) {
15 foo(4, 5);
16 foo(39, 40);
17 return 0;