1 // RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t
2 // RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll
3 // RUN: %run %t %t.dll | FileCheck %s
9 // FIXME: remove after mingw-w64 adds this declaration.
10 extern "C" size_t __cdecl
_aligned_msize(void *_Memory
, size_t _Alignment
, size_t _Offset
);
13 #define CHECK_ALIGNED(ptr,alignment) \
15 if (((uintptr_t)(ptr) % (alignment)) != 0) \
20 extern "C" __declspec(dllexport
)
22 int *p
= (int*)_aligned_malloc(1024 * sizeof(int), 32);
27 p
= (int*)_aligned_malloc(128, 128);
28 CHECK_ALIGNED(p
, 128);
29 p
= (int*)_aligned_realloc(p
, 2048 * sizeof(int), 128);
30 CHECK_ALIGNED(p
, 128);
32 if (_aligned_msize(p
, 128, 0) != 2048 * sizeof(int))