1 #include "sanitizer\allocator_interface.h"
5 // RUN: %clang_cl_asan %s -o%t
6 // RUN: %env_asan_opts=windows_hook_rtl_allocators=true %run %t 2>&1 | FileCheck %s
7 // UNSUPPORTED: asan-64-bits
11 void *alloc
= HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS
, 100);
14 alloc
= HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS
, alloc
, 100);
15 assert(alloc
&& !__sanitizer_get_ownership(alloc
) && HeapValidate(GetProcessHeap(), 0, alloc
));
16 //convert to asan owned
17 void *realloc
= HeapReAlloc(GetProcessHeap(), 0, alloc
, 500);
19 assert(realloc
&& __sanitizer_get_ownership(realloc
));
20 //convert back to rtl owned;
21 alloc
= HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS
, realloc
, 100);
22 assert(alloc
&& !__sanitizer_get_ownership(alloc
) && HeapValidate(GetProcessHeap(), 0, alloc
));
27 // CHECK-NOT: AddressSanitizer