Revert "[lldb][test] Remove compiler version check and use regex" (#124101)
[llvm-project.git] / compiler-rt / test / asan / TestCases / on_error_callback.cpp
blobc38a36f0e33bdaf50b01311df0f62a0c4130daba
1 // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
3 #include <stdio.h>
4 #include <stdlib.h>
6 // Required for dyld macOS 12.0+
7 #if (__APPLE__)
8 __attribute__((weak))
9 #endif
10 extern "C" void
11 __asan_on_error() {
12 fprintf(stderr, "__asan_on_error called\n");
13 fflush(stderr);
16 int main() {
17 char *x = (char*)malloc(10 * sizeof(char));
18 free(x);
19 return x[5];
20 // CHECK: __asan_on_error called