Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / Darwin / asan_log_to_crashreporter.cpp
blobcf97b8afd129ef627900c822429bbe39f56586e0
1 // UNSUPPORTED: ios
2 // We can reduce the scope of this test to check that we set the crash reporter
3 // buffers correctly instead of reading from the crashlog.
4 // For now, disable this test.
5 // REQUIRES: rdar_74544282
6 // REQUIRES: expensive
7 // Check that ASan reports on OS X actually crash the process (abort_on_error=1)
8 // and that crash is logged via the crash reporter with ASan logs in the
9 // Application Specific Information section of the log.
11 // RUN: %clangxx_asan %s -o %t
13 // crash hard so the crashlog is created.
14 // RUN: %env_asan_opts=abort_on_error=1 not --crash %run %t > %t.process_output.txt 2>&1
15 // RUN: %print_crashreport_for_pid --binary-filename=%basename_t.tmp \
16 // RUN: --pid=$(%get_pid_from_output --infile=%t.process_output.txt) \
17 // RUN: | FileCheck %s --check-prefixes CHECK-CRASHLOG
19 #include <stdlib.h>
20 int main() {
21 char *x = (char *)malloc(10 * sizeof(char));
22 free(x);
23 return x[5];
24 // needs to crash hard so the crashlog exists...
25 // CHECK-CRASHLOG: {{.*Application Specific Information:}}
26 // CHECK-CRASHLOG-NEXT: {{=====}}
27 // CHECK-CRASHLOG-NEXT: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
28 // CHECK-CRASHLOG: {{abort()}}