brintos

brintos / llvm-project-archived public Read only

0
0
Text · 931 B · eb02a30 Raw
36 lines · c
1// Test that on non-glibc platforms, a number of malloc-related functions are2// not intercepted.3 4// RUN: not %clang_asan -Dtestfunc=mallinfo %s -o %t5// RUN: not %clang_asan -Dtestfunc=mallopt  %s -o %t6// RUN: not %clang_asan -Dtestfunc=memalign %s -o %t7// RUN: not %clang_asan -Dtestfunc=pvalloc  %s -o %t8// RUN: not %clang_asan -Dtestfunc=cfree    %s -o %t9 10// REQUIRES: glibc-2.2711// Conflicts with BIONIC declarations.12// Lacks mallinfo, mallopt except in libmalloc.  cfree with different13// signature in libc.14// UNSUPPORTED: target={{.*solaris.*}}15 16// Inhibit conflicting declaration of memalign on Solaris.17#if defined(__sun__) && defined(__svr4__)18#undef __EXTENSIONS__19#endif20 21#include <stdlib.h>22 23// For glibc, cause link failures by referencing a nonexistent function.24#ifdef __GLIBC__25#undef testfunc26#define testfunc nonexistent_function27#endif28 29void testfunc(void);30 31int main(void)32{33  testfunc();34  return 0;35}36