Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / malloc-no-intercept.c
blobeb02a30594a1c63ca58caf2a98337587b347f48f
1 // Test that on non-glibc platforms, a number of malloc-related functions are
2 // not intercepted.
4 // RUN: not %clang_asan -Dtestfunc=mallinfo %s -o %t
5 // RUN: not %clang_asan -Dtestfunc=mallopt %s -o %t
6 // RUN: not %clang_asan -Dtestfunc=memalign %s -o %t
7 // RUN: not %clang_asan -Dtestfunc=pvalloc %s -o %t
8 // RUN: not %clang_asan -Dtestfunc=cfree %s -o %t
10 // REQUIRES: glibc-2.27
11 // Conflicts with BIONIC declarations.
12 // Lacks mallinfo, mallopt except in libmalloc. cfree with different
13 // signature in libc.
14 // UNSUPPORTED: target={{.*solaris.*}}
16 // Inhibit conflicting declaration of memalign on Solaris.
17 #if defined(__sun__) && defined(__svr4__)
18 #undef __EXTENSIONS__
19 #endif
21 #include <stdlib.h>
23 // For glibc, cause link failures by referencing a nonexistent function.
24 #ifdef __GLIBC__
25 #undef testfunc
26 #define testfunc nonexistent_function
27 #endif
29 void testfunc(void);
31 int main(void)
33 testfunc();
34 return 0;