xref: /llvm-project/compiler-rt/test/memprof/TestCases/memprof_profile_dump_on_abort.cpp (revision 9e80add2cfa9bb03bbe77cca9adec18137204538)
1 // RUN: %clangxx_memprof %s -o %t
2 
3 // RUN: %env_memprof_opts=print_text=true:log_path=stdout:handle_abort=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-TEXT %s
4 
5 #include <stdlib.h>
6 #include <string.h>
main(int argc,char ** argv)7 int main(int argc, char **argv) {
8   char *x = (char *)malloc(10);
9   memset(x, 0, 10);
10   free(x);
11   abort();
12   return 0;
13 }
14 
15 // CHECK-TEXT: MemProfiler:DEADLYSIGNAL
16 // CHECK-TEXT: Recorded MIBs (incl. live on exit):
17 // CHECK-TEXT: Memory allocation stack id
18 // CHECK-TEXT: Stack for id
19