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