Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / error_report_callback.cpp
blob8c5bbe418fc52116fc2f3d2a5b790ddfdee0e6a7
1 // RUN: %clangxx_asan -O0 %s -o %t
2 // RUN: not %run %t 0 2>&1 | FileCheck %s
4 #include <sanitizer/asan_interface.h>
5 #include <stdio.h>
7 static void ErrorReportCallbackOneToZ(const char *report) {
8 fprintf(stderr, "ABCDEF%sGHIJKL", report);
9 fflush(stderr);
12 int main(int argc, char **argv) {
13 __asan_set_error_report_callback(ErrorReportCallbackOneToZ);
14 __asan_report_error(
15 (void *)__builtin_extract_return_addr(__builtin_return_address(0)), 0, 0,
16 0, true, 1);
17 // CHECK: ABCDEF
18 // CHECK: ERROR: AddressSanitizer
19 // CHECK: GHIJKL
20 return 0;