Files
clang-p2996/compiler-rt/test/memprof/TestCases/dump_at_exit.cpp
Ellis Hoag 968e3b6823 [memprof] Add flag to control profile dump at exit (#119452)
Add the `dump_at_exit` flag to control whether or not profiles should be
dumped when the program exits. Since we can call
`__memprof_profile_dump()` directly, we don't necessarily need to dump
profiles at exit.
2024-12-10 13:12:08 -08:00

17 lines
386 B
C++

// RUN: %clangxx_memprof %s -o %t
// RUN: %env_memprof_opts=print_text=true:log_path=stdout:dump_at_exit=false %run %t | count 0
// RUN: %env_memprof_opts=print_text=true:log_path=stdout:dump_at_exit=true %run %t | FileCheck %s
#include <stdlib.h>
#include <string.h>
int main() {
char *x = (char *)malloc(10);
memset(x, 0, 10);
free(x);
return 0;
}
// CHECK: Recorded MIBs