summaryrefslogtreecommitdiff
path: root/test/sanitizer_common
diff options
context:
space:
mode:
authorMaxim Ostapenko <m.ostapenko@partner.samsung.com>2017-01-31 07:15:37 +0000
committerMaxim Ostapenko <m.ostapenko@partner.samsung.com>2017-01-31 07:15:37 +0000
commitf9b0137a0dafa41f6834fd25c1aebe6314091dec (patch)
tree229ad9b98435ef7f58f947d9f643f5137802c2bd /test/sanitizer_common
parent1490662a76d7488609ed993cf4499b26e3a6774f (diff)
[lsan] Renable LSan for x86 Linux
The missed clang part was committed at https://reviews.llvm.org/rL293609 thus we can reenable LSan for x86 Linux. Differential Revision: https://reviews.llvm.org/D28609 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/sanitizer_common')
-rw-r--r--test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc7
-rw-r--r--test/sanitizer_common/TestCases/corelimit.cc2
-rw-r--r--test/sanitizer_common/lit.common.cfg3
-rw-r--r--test/sanitizer_common/print_address.h2
4 files changed, 13 insertions, 1 deletions
diff --git a/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc b/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc
index fdb68c0cd..12a56c73e 100644
--- a/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc
+++ b/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc
@@ -2,6 +2,13 @@
// REQUIRES: stable-runtime
+// For standalone LSan on x86 we have a problem: compiler spills the address
+// of allocated at line 42 memory thus memory block allocated in Leak() function
+// ends up to be classified as reachable despite the fact we zero out 'sink' at
+// the last line of main function. The problem doesn't reproduce with ASan because
+// quarantine prohibits memory block reuse for different allocations.
+// XFAIL: lsan-x86
+
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
diff --git a/test/sanitizer_common/TestCases/corelimit.cc b/test/sanitizer_common/TestCases/corelimit.cc
index 8f54940d0..0a86e5b7b 100644
--- a/test/sanitizer_common/TestCases/corelimit.cc
+++ b/test/sanitizer_common/TestCases/corelimit.cc
@@ -1,5 +1,5 @@
// RUN: %clangxx -O0 %s -o %t && %run %t
-// XFAIL: lsan
+// UNSUPPORTED: lsan
#include <assert.h>
#include <sys/time.h>
diff --git a/test/sanitizer_common/lit.common.cfg b/test/sanitizer_common/lit.common.cfg
index b32fb1ba9..2926edb12 100644
--- a/test/sanitizer_common/lit.common.cfg
+++ b/test/sanitizer_common/lit.common.cfg
@@ -26,6 +26,9 @@ config.available_features.add(config.tool_name)
if config.target_arch not in ['arm', 'armhf', 'aarch64']:
config.available_features.add('stable-runtime')
+if config.host_os == 'Linux' and config.target_arch == 'i386' and config.tool_name == "lsan":
+ config.available_features.add("lsan-x86")
+
if config.host_os == 'Darwin':
# On Darwin, we default to `abort_on_error=1`, which would make tests run
# much slower. Let's override this and run lit tests with 'abort_on_error=0'.
diff --git a/test/sanitizer_common/print_address.h b/test/sanitizer_common/print_address.h
index 018db6180..99261b331 100644
--- a/test/sanitizer_common/print_address.h
+++ b/test/sanitizer_common/print_address.h
@@ -11,6 +11,8 @@ void print_address(const char *str, int n, ...) {
// On FreeBSD, the %p conversion specifier works as 0x%x and thus does not
// match to the format used in the diagnotic message.
fprintf(stderr, "0x%012lx ", (unsigned long) p);
+#elif defined(__i386__)
+ fprintf(stderr, "0x%8lx ", (unsigned long) p);
#elif defined(__mips64)
fprintf(stderr, "0x%010lx ", (unsigned long) p);
#endif