aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-02-05 19:37:47 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-02-05 19:37:47 +0000
commit9b201f5d5e4ae2a3b15fc7ae974e808a0964a0c0 (patch)
treece7ad5d8c7aa3f9cdb48dab34d7891e8931f0f57 /test
parent3dfdcbdf6f1f1ecb2acd9c1fb600d5ebf11219e7 (diff)
downloadsrc-9b201f5d5e4ae2a3b15fc7ae974e808a0964a0c0.tar.gz
src-9b201f5d5e4ae2a3b15fc7ae974e808a0964a0c0.zip
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=313293 svn path=/vendor/compiler-rt/compiler-rt-release_40-r294803/; revision=313637; tag=vendor/compiler-rt/compiler-rt-release_40-r294803
Diffstat (limited to 'test')
-rw-r--r--test/asan/TestCases/malloc-no-intercept.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/asan/TestCases/malloc-no-intercept.c b/test/asan/TestCases/malloc-no-intercept.c
new file mode 100644
index 000000000000..563f2ab15691
--- /dev/null
+++ b/test/asan/TestCases/malloc-no-intercept.c
@@ -0,0 +1,24 @@
+// Test that on non-glibc platforms, a number of malloc-related functions are
+// not intercepted.
+
+// RUN: not %clang_asan -Dtestfunc=mallinfo %s -o %t
+// RUN: not %clang_asan -Dtestfunc=mallopt %s -o %t
+// RUN: not %clang_asan -Dtestfunc=memalign %s -o %t
+// RUN: not %clang_asan -Dtestfunc=pvalloc %s -o %t
+// RUN: not %clang_asan -Dtestfunc=cfree %s -o %t
+
+#include <stdlib.h>
+
+// For glibc, cause link failures by referencing a nonexistent function.
+#ifdef __GLIBC__
+#undef testfunc
+#define testfunc nonexistent_function
+#endif
+
+void testfunc(void);
+
+int main(void)
+{
+ testfunc();
+ return 0;
+}