[ASan/Win] Handle situations when the client app has used DbgHelp before
[blocksruntime.git] / test / asan / TestCases / Windows / report_after_syminitialize.cc
blob8a56bf08731081dffdc28a3334548bc84aef08af
1 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
3 #include <windows.h>
4 #include <dbghelp.h>
6 int main() {
7 // Make sure the RTL recovers from "no options enabled" dbghelp setup.
8 SymSetOptions(0);
10 // Make sure the RTL recovers from "fInvadeProcess=FALSE".
11 if (!SymInitialize(GetCurrentProcess(), 0, FALSE))
12 return 42;
14 *(int*)0 = 42;
15 // CHECK: ERROR: AddressSanitizer: access-violation on unknown address
16 // CHECK-NEXT: {{#0 0x.* in main.*report_after_syminitialize.cc:}}[[@LINE-2]]
17 // CHECK: AddressSanitizer can not provide additional info.