summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/Windows/report_after_syminitialize.cc
blob: faf5e35db5f54df3a2b7690ab2a22e954afc059b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s

#include <windows.h>
#include <dbghelp.h>

int main() {
  // Make sure the RTL recovers from "no options enabled" dbghelp setup.
  SymSetOptions(0);

  // Make sure the RTL recovers from "fInvadeProcess=FALSE".
  if (!SymInitialize(GetCurrentProcess(), 0, FALSE))
    return 42;

  *(volatile int*)0 = 42;
  // CHECK: ERROR: AddressSanitizer: access-violation on unknown address
  // CHECK-NEXT: {{WARNING: .*DbgHelp}}
  // CHECK: {{#0 0x.* in main.*report_after_syminitialize.cc:}}[[@LINE-3]]
  // CHECK: AddressSanitizer can not provide additional info.
}