summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2014-11-15 23:00:14 +0000
committerJay Foad <jay.foad@gmail.com>2014-11-15 23:00:14 +0000
commit6f976817d6081d41f10cc29f0ec9da0693d8bfd2 (patch)
treebc679bce624777876ec43465fab65ec8df550c9a
parent6e21266b6021aaa4f31227ba09f48c0f53c65274 (diff)
[ASan] Fix leak tests on 64-bit targets other than x86-64
Summary: This test explicitly sets ASAN_OPTIONS=detect_leaks=1 which is only supported on x86-64. The test is currently restricted to run only on 64-bit targets, but needs to be restricted further so it only runs on x86-64. Reviewers: kcc, eugenis, earthdok, samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6189 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222091 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/asan/TestCases/Linux/coverage-and-lsan.cc2
-rw-r--r--test/asan/TestCases/Linux/leak.cc2
-rw-r--r--test/asan/lit.cfg5
3 files changed, 5 insertions, 4 deletions
diff --git a/test/asan/TestCases/Linux/coverage-and-lsan.cc b/test/asan/TestCases/Linux/coverage-and-lsan.cc
index f0d371f15..4cb8e2af3 100644
--- a/test/asan/TestCases/Linux/coverage-and-lsan.cc
+++ b/test/asan/TestCases/Linux/coverage-and-lsan.cc
@@ -8,7 +8,7 @@
// RUN: ASAN_OPTIONS=coverage=1:coverage_dir=%T/coverage-and-lsan:verbosity=1 not %run %t 2>&1 | FileCheck %s
// RUN: %sancov print %T/coverage-and-lsan/*.sancov 2>&1
//
-// REQUIRES: asan-64-bits
+// REQUIRES: leak-detection
int *g = new int;
int main(int argc, char **argv) {
diff --git a/test/asan/TestCases/Linux/leak.cc b/test/asan/TestCases/Linux/leak.cc
index df7850fa3..36dc6ddb8 100644
--- a/test/asan/TestCases/Linux/leak.cc
+++ b/test/asan/TestCases/Linux/leak.cc
@@ -1,5 +1,5 @@
// Minimal test for LeakSanitizer+AddressSanitizer.
-// REQUIRES: asan-64-bits
+// REQUIRES: leak-detection
//
// RUN: %clangxx_asan %s -o %t
// RUN: ASAN_OPTIONS=detect_leaks=1 not %run %t 2>&1 | FileCheck %s
diff --git a/test/asan/lit.cfg b/test/asan/lit.cfg
index 2acc54293..5208ebfec 100644
--- a/test/asan/lit.cfg
+++ b/test/asan/lit.cfg
@@ -122,9 +122,10 @@ config.available_features.add("asan-" + config.bits + "-bits")
if config.target_arch != 'arm':
config.available_features.add('stable-runtime')
-# Turn on leak detection on 64-bit Linux.
-if config.host_os == 'Linux' and config.bits == '64':
+# Turn on leak detection on x86_64 Linux.
+if config.host_os == 'Linux' and config.host_arch == 'x86_64':
config.environment['ASAN_OPTIONS'] = 'detect_leaks=1'
+ config.available_features.add('leak-detection')
# Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
push_ld_library_path(config, config.compiler_rt_libdir)