Files
clang-p2996/compiler-rt/test/asan/TestCases/on_error_callback.cpp
Nico Weber 673dc3d4a0 compiler-rt: Rename cc files below test/asan to cpp
See r367803 and similar other changes.

llvm-svn: 367887
2019-08-05 16:48:12 +00:00

21 lines
400 B
C++

// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
// FIXME: Doesn't work with DLLs
// XFAIL: win32-dynamic-asan
#include <stdio.h>
#include <stdlib.h>
extern "C"
void __asan_on_error() {
fprintf(stderr, "__asan_on_error called\n");
fflush(stderr);
}
int main() {
char *x = (char*)malloc(10 * sizeof(char));
free(x);
return x[5];
// CHECK: __asan_on_error called
}