summaryrefslogtreecommitdiff
path: root/compiler-rt/test/memprof/TestCases/dump_at_exit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/memprof/TestCases/dump_at_exit.cpp')
-rw-r--r--compiler-rt/test/memprof/TestCases/dump_at_exit.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler-rt/test/memprof/TestCases/dump_at_exit.cpp b/compiler-rt/test/memprof/TestCases/dump_at_exit.cpp
new file mode 100644
index 000000000000..426849d1cea0
--- /dev/null
+++ b/compiler-rt/test/memprof/TestCases/dump_at_exit.cpp
@@ -0,0 +1,16 @@
+// 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