1// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2
3#include <stdio.h>
4
5#if !defined(_MSC_VER) || defined(__clang__)
6// Required for ld64 macOS 12.0+
7__attribute__((weak)) extern "C" void foo() {}
8#endif
9
10extern "C" void __sanitizer_report_error_summary(const char *summary) {
11 fprintf(stderr, format: "test_report_error_summary\n");
12 // CHECK: test_report_error_summary
13 fflush(stderr);
14}
15
16char *x;
17
18int main() {
19 x = new char[20];
20 delete[] x;
21 return x[0];
22}
23

Provided by KDAB

Privacy Policy
Improve your Profiling and Debugging skills
Find out more

source code of compiler-rt/test/asan/TestCases/report_error_summary.cpp