• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
2 
3 // FIXME: __asan_on_error() is not supported on Windows yet.
4 // XFAIL: win32
5 
6 #include <stdio.h>
7 #include <stdlib.h>
8 
9 extern "C"
__asan_on_error()10 void __asan_on_error() {
11   fprintf(stderr, "__asan_on_error called");
12 }
13 
main()14 int main() {
15   char *x = (char*)malloc(10 * sizeof(char));
16   free(x);
17   return x[5];
18   // CHECK: __asan_on_error called
19 }
20