[compiler-rt] r264766 - [asan] Make the Darwin/dead-strip.c test require El Capitan or newer

Ryan Govostes via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 11:54:30 PDT 2016


Author: rgov
Date: Tue Mar 29 13:54:29 2016
New Revision: 264766

URL: http://llvm.org/viewvc/llvm-project?rev=264766&view=rev
Log:
[asan] Make the Darwin/dead-strip.c test require El Capitan or newer

Modified:
    compiler-rt/trunk/test/asan/TestCases/Darwin/dead-strip.c
    compiler-rt/trunk/test/lit.common.cfg

Modified: compiler-rt/trunk/test/asan/TestCases/Darwin/dead-strip.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Darwin/dead-strip.c?rev=264766&r1=264765&r2=264766&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Darwin/dead-strip.c (original)
+++ compiler-rt/trunk/test/asan/TestCases/Darwin/dead-strip.c Tue Mar 29 13:54:29 2016
@@ -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

Modified: compiler-rt/trunk/test/lit.common.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=264766&r1=264765&r2=264766&view=diff
==============================================================================
--- compiler-rt/trunk/test/lit.common.cfg (original)
+++ compiler-rt/trunk/test/lit.common.cfg Tue Mar 29 13:54:29 2016
@@ -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):




More information about the llvm-commits mailing list