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