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"); 9 } 10 main()11int main() { 12 char *x = (char*)malloc(10 * sizeof(char)); 13 free(x); 14 return x[5]; 15 // CHECK: __asan_on_error called 16 } 17