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