1 // RUN: %clang_cl_asan -Od %p/../dll_host.cpp -Fe%t
3 // Check both -GS and -GS- builds:
4 // RUN: %clang_cl_asan -GS -LD -Od %s -Fe%t.dll
7 // RUN: %clang_cl_asan -GS- -LD -Od %s -Fe%t.dll
14 // Should just "#include <sanitizer/asan_interface.h>" when C++ exceptions are
15 // supported and we don't need to use CL.
16 extern "C" bool __asan_address_is_poisoned(void *p
);
23 fprintf(stderr
, "Throw: %p\n", &local
);
28 void ThrowAndCatch() {
32 } __except(EXCEPTION_EXECUTE_HANDLER
) {
33 fprintf(stderr
, "__except: %p\n", &local
);
37 extern "C" __declspec(dllexport
)
40 fprintf(stderr
, "Before: %p poisoned: %d\n", &x
,
41 __asan_address_is_poisoned(x
+ 32));
42 assert(__asan_address_is_poisoned(x
+ 32));
44 fprintf(stderr
, "After: %p poisoned: %d\n", &x
,
45 __asan_address_is_poisoned(x
+ 32));
46 // FIXME: Invert this assertion once we fix
47 // https://code.google.com/p/address-sanitizer/issues/detail?id=258
48 assert(!__asan_address_is_poisoned(x
+ 32));