aboutsummaryrefslogtreecommitdiff
path: root/lib/asan/lit_tests/TestCases/symbolize_callback.cc
blob: 058b3150fbba1198f5a94318aea40c967093c458 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %clangxx_asan -O2 %s -o %t && not %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
}