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

// FIXME: __asan_on_error() is not supported on Windows yet.
// XFAIL: win32

#include <stdio.h>
#include <stdlib.h>

extern "C"
void __asan_on_error() {
  fprintf(stderr, "__asan_on_error called");
}

int main() {
  char *x = (char*)malloc(10 * sizeof(char));
  free(x);
  return x[5];
  // CHECK: __asan_on_error called
}