aboutsummaryrefslogtreecommitdiff
path: root/test/asan/TestCases/atexit_stats.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/atexit_stats.cc')
-rw-r--r--test/asan/TestCases/atexit_stats.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/asan/TestCases/atexit_stats.cc b/test/asan/TestCases/atexit_stats.cc
new file mode 100644
index 000000000000..be6534475245
--- /dev/null
+++ b/test/asan/TestCases/atexit_stats.cc
@@ -0,0 +1,18 @@
+// Make sure we report atexit stats.
+// RUN: %clangxx_asan -O3 %s -o %t
+// RUN: env ASAN_OPTIONS=atexit=1:print_stats=1 %run %t 2>&1 | FileCheck %s
+//
+// No atexit output on Android due to
+// https://code.google.com/p/address-sanitizer/issues/detail?id=263
+// XFAIL: android
+
+#include <stdlib.h>
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#include <malloc.h>
+#endif
+int *p1 = (int*)malloc(900);
+int *p2 = (int*)malloc(90000);
+int *p3 = (int*)malloc(9000000);
+int main() { }
+
+// CHECK: AddressSanitizer exit stats: