summaryrefslogtreecommitdiff
path: root/lib/asan/lit_tests
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-10-18 07:57:59 +0000
committerKostya Serebryany <kcc@google.com>2013-10-18 07:57:59 +0000
commita2e70d92b67703effb631d7b4db8979fd74d5db5 (patch)
treecdf5fd1acceda82d250b4170f486a26961668470 /lib/asan/lit_tests
parent0c46cdebe103e5745a3b7be0b8c9c454a06bcccb (diff)
downloadcompiler-rt-a2e70d92b67703effb631d7b4db8979fd74d5db5.tar.gz
compiler-rt-a2e70d92b67703effb631d7b4db8979fd74d5db5.tar.bz2
compiler-rt-a2e70d92b67703effb631d7b4db8979fd74d5db5.tar.xz
[asan] fix atexit stats
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/lit_tests')
-rw-r--r--lib/asan/lit_tests/TestCases/assign_large_valloc_to_global.cc3
-rw-r--r--lib/asan/lit_tests/TestCases/atexit_stats.cc11
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/asan/lit_tests/TestCases/assign_large_valloc_to_global.cc b/lib/asan/lit_tests/TestCases/assign_large_valloc_to_global.cc
index 87a65984..e5b2e661 100644
--- a/lib/asan/lit_tests/TestCases/assign_large_valloc_to_global.cc
+++ b/lib/asan/lit_tests/TestCases/assign_large_valloc_to_global.cc
@@ -1,9 +1,6 @@
// Make sure we don't report a leak nor hang.
// RUN: %clangxx_asan -O3 %s -o %t && %t
-#if defined(__APPLE__)
#include <stdlib.h>
-#else
#include <malloc.h>
-#endif
int *p = (int*)valloc(1 << 20);
int main() { }
diff --git a/lib/asan/lit_tests/TestCases/atexit_stats.cc b/lib/asan/lit_tests/TestCases/atexit_stats.cc
new file mode 100644
index 00000000..10b4fac4
--- /dev/null
+++ b/lib/asan/lit_tests/TestCases/atexit_stats.cc
@@ -0,0 +1,11 @@
+// Make sure we report atexit stats.
+// RUN: %clangxx_asan -O3 %s -o %t
+// RUN: ASAN_OPTIONS=atexit=1:print_stats=1 %t 2>&1 | FileCheck %s
+#include <stdlib.h>
+#include <malloc.h>
+int *p1 = (int*)malloc(900);
+int *p2 = (int*)malloc(90000);
+int *p3 = (int*)malloc(9000000);
+int main() { }
+
+// CHECK: AddressSanitizer exit stats: