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 | |
10 | extern "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 | |
16 | char *x; |
17 | |
18 | int main() { |
19 | x = new char[20]; |
20 | delete[] x; |
21 | return x[0]; |
22 | } |
23 |