1// UNSUPPORTED: asan-64-bits
2// RUN: %clang_cl_asan %Od %s %Fe%t
3// RUN: %env_asan_opts=windows_hook_rtl_allocators=true not %run %t 2>&1 | FileCheck %s
4
5#include <windows.h>
6
7int main() {
8 char *buffer;
9 buffer = (char *)HeapAlloc(GetProcessHeap(), 0, 32),
10 buffer[33] = 'a';
11 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
12 // CHECK: WRITE of size 1 at [[ADDR]] thread T0
13}
14

source code of compiler-rt/test/asan/TestCases/Windows/heapalloc.cpp