diff options
Diffstat (limited to 'lib/asan/lit_tests/symbolize_callback.cc')
| -rw-r--r-- | lib/asan/lit_tests/symbolize_callback.cc | 17 | 
1 files changed, 17 insertions, 0 deletions
| diff --git a/lib/asan/lit_tests/symbolize_callback.cc b/lib/asan/lit_tests/symbolize_callback.cc new file mode 100644 index 0000000000000..0691d501e24db --- /dev/null +++ b/lib/asan/lit_tests/symbolize_callback.cc @@ -0,0 +1,17 @@ +// RUN: %clangxx_asan -O2 %s -o %t && %t 2>&1 | FileCheck %s + +#include <stdio.h> +#include <stdlib.h> + +extern "C" +bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) { +  snprintf(out_buffer, out_size, "MySymbolizer"); +  return true; +} + +int main() { +  char *x = (char*)malloc(10 * sizeof(char)); +  free(x); +  return x[5]; +  // CHECK: MySymbolizer +} | 
