23 lines · cpp
1// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s2 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#endif9 10extern "C" void __sanitizer_report_error_summary(const char *summary) {11 fprintf(stderr, "test_report_error_summary\n");12 // CHECK: test_report_error_summary13 fflush(stderr);14}15 16char *x;17 18int main() {19 x = new char[20];20 delete[] x;21 return x[0];22}23