1 // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s 2 3 // FIXME: Doesn't work with DLLs 4 // XFAIL: win32-dynamic-asan 5 6 #include <stdio.h> 7 #include <stdlib.h> 8 9 extern "C" __asan_on_error()10void __asan_on_error() { 11 fprintf(stderr, "__asan_on_error called\n"); 12 fflush(stderr); 13 } 14 main()15int main() { 16 char *x = (char*)malloc(10 * sizeof(char)); 17 free(x); 18 return x[5]; 19 // CHECK: __asan_on_error called 20 } 21