summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRyan Govostes <rzg@apple.com>2016-03-29 18:54:29 +0000
committerRyan Govostes <rzg@apple.com>2016-03-29 18:54:29 +0000
commitcc14c4ea43f0f3330d7bbac3cd1327e428bc9a3a (patch)
treefa2fc39598e13e808128e8de8f8d2c7353b04bda /test
parentf954b265829739a577c0272f2c6d7093a72716e2 (diff)
[asan] Make the Darwin/dead-strip.c test require El Capitan or newer
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/asan/TestCases/Darwin/dead-strip.c1
-rw-r--r--test/lit.common.cfg14
2 files changed, 9 insertions, 6 deletions
diff --git a/test/asan/TestCases/Darwin/dead-strip.c b/test/asan/TestCases/Darwin/dead-strip.c
index 3b9bb3db6..e016e372b 100644
--- a/test/asan/TestCases/Darwin/dead-strip.c
+++ b/test/asan/TestCases/Darwin/dead-strip.c
@@ -5,6 +5,7 @@
// detected after dead stripping has been performed. This proves that the
// runtime is able to register globals in the __DATA,__asan_globals section.
+// REQUIRES: osx-ld64-live_support
// RUN: %clang_asan -Xlinker -dead_strip -o %t %s
// RUN: llvm-nm -format=posix %t | FileCheck --check-prefix NM-CHECK %s
// RUN: not %run %t 2>&1 | FileCheck --check-prefix ASAN-CHECK %s
diff --git a/test/lit.common.cfg b/test/lit.common.cfg
index 595a9e919..e0f9b2717 100644
--- a/test/lit.common.cfg
+++ b/test/lit.common.cfg
@@ -119,12 +119,14 @@ if config.can_symbolize:
lit.util.usePlatformSdkOnDarwin(config, lit_config)
if config.host_os == 'Darwin':
- ld_cmd = subprocess.Popen(["bash", "-c", "sw_vers -productVersion | awk -F '.' '{print $1 \".\" $2}'"], stdout = subprocess.PIPE)
- ld_out = ld_cmd.stdout.read().decode()
- ld_cmd.wait()
- osx_version = float(ld_out)
- if osx_version >= 10.11:
- config.available_features.add('osx-autointerception')
+ try:
+ osx_version = subprocess.check_output(["sw_vers", "-productVersion"])
+ osx_version = tuple(int(x) for x in osx_version.split('.'))
+ if osx_version >= (10, 11):
+ config.available_features.add('osx-autointerception')
+ config.available_features.add('osx-ld64-live_support')
+ except:
+ pass
sancovcc_path = os.path.join(llvm_tools_dir, "sancov")
if os.path.exists(sancovcc_path):