1 //===-- lsan_testlib.cc ---------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of LeakSanitizer.
11 // Standalone LSan tool as a shared library, to be used with LD_PRELOAD.
13 //===----------------------------------------------------------------------===//
15 clang++ ../sanitizer_common/sanitizer_*.cc ../interception/interception_*.cc \
16 lsan*.cc tests/lsan_testlib.cc -I. -I.. -g -ldl -lpthread -fPIC -shared -O2 \
18 LD_PRELOAD=./lsan.so /your/app
22 __attribute__((constructor
))