From 9b201f5d5e4ae2a3b15fc7ae974e808a0964a0c0 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 5 Feb 2017 19:37:47 +0000 Subject: Vendor import of compiler-rt release_40 branch r294123: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_40@294123 --- test/asan/TestCases/malloc-no-intercept.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/asan/TestCases/malloc-no-intercept.c (limited to 'test') diff --git a/test/asan/TestCases/malloc-no-intercept.c b/test/asan/TestCases/malloc-no-intercept.c new file mode 100644 index 0000000000000..563f2ab15691e --- /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 + +// 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; +} -- cgit v1.2.3