1 // RUN: %clangxx_asan -O0 %s -o %t
2 // RUN: %env_asan_opts=external_symbolizer_path=asdf not %run %t 2>&1 | FileCheck %s
3 
4 #include <windows.h>
5 #include <dbghelp.h>
6 
7 #pragma comment(lib, "dbghelp")
8 
main()9 int main() {
10   // Make sure the RTL recovers from "no options enabled" dbghelp setup.
11   SymSetOptions(0);
12 
13   // Make sure the RTL recovers from "fInvadeProcess=FALSE".
14   if (!SymInitialize(GetCurrentProcess(), 0, FALSE))
15     return 42;
16 
17   *(volatile int*)0 = 42;
18   // CHECK: ERROR: AddressSanitizer: access-violation on unknown address
19   // CHECK: The signal is caused by a WRITE memory access.
20   // CHECK: Hint: address points to the zero page.
21   // CHECK: {{WARNING: .*DbgHelp}}
22   // CHECK: {{WARNING: Failed to use and restart external symbolizer}}
23   // CHECK: {{#0 0x.* in main.*report_after_syminitialize.cpp:}}[[@LINE-6]]
24   // CHECK: AddressSanitizer can not provide additional info.
25 }
26